.... will work on one page and yet not another... simplified for ease of reading, banging my head.
I tried it using a response.text from an xmlHttp type "request" - would not alter the id=''
I got the "clean" response.text as I poked it into a JS alert box to see it...
so tried forcing it with a manual submit button using some nonense text - wil not change
built a super simple change with a manual submit button - works!
Thanks in advance from me and my skull with a new flat spot,
GREG...
-----
WORKS ON THIS PAGE <simple_test.ht m>:
[CODE=html]
<html>
<head>
<script type="text/javascript">
function changeText() {
document.getEle mentById('site_ info').innerHTM L = 'Fred Flinstone';
}
</script>
</head>
<body>
<p>
Welcome to the site <b id='juicy_text' >dude</b>
</p>
<input type='button' onclick='change Text()' value='Change Text'/>
</body>
</html>[/CODE]
-------------
DOESN'T WORK ON THIS PAGE - <test.php>
[CODE=html]<html>
<head>
<title>Try Adjusting based on Selection and PostgreSQL connection</title>
<script language="JavaS cript" src="select_sit e.js"></script> //not included as irrevalant for this forced test
<script type="text/javascript">
function fun_manual_chan ge_text() {
document.getEle mentById('juicy _text').innerHT ML = 'Fred Flinstone';
}
</script>
</head>
<body>
<?php
//set up the PostgreSQL database connection used throughout
$db_connect=pg_ connect("host=[munge] dbname=[munge] user=[munge] password=[munge]") or die(pg_last_err or($db_conn));
//SUM of SITE data for analytical data showing on web page
$SQL_Query = " SELECT site_id, site_id_abrev
FROM d_site
WHERE country<>'NA'
ORDER BY site_id
";
$query_result=p g_query($db_con nect, $SQL_Query);
$counter=0;
while($row_data =pg_fetch_array ($query_result) ) {
$counter+=1;
$ary_sites[$counter] = $row_data["site_id"];
$ary_abbrevs[$counter] = $row_data["site_id_ab rev"];
}
?>
<h2 align="center" style="color:gr een">Try AJAX with Strathmore Data out of PostgreSQL</h2>
<form>
<b>Select a Site:</b><br />
<select name="sites" onchange="fun_g et_site_details (this.value)">
<?php
$counter=0;
foreach($ary_si tes as $dummy) {
$counter+=1;
print "<option value=\"".$ary_ abbrevs[$counter]."\">".$ary_sit es[$counter]."</option>";
}
?>
</select>
<br />
<br />
<input type='button' onclick='fun_ma nual_change_tex t' value='Change Text Manually'/>
</form>
<br />
<br />
<p>
<b>Site Info.:</b><br />
<div id='site_info'>
Some info for the selected site will be listed here...
</div>
</p>
</body>
</html>[/CODE]
I tried it using a response.text from an xmlHttp type "request" - would not alter the id=''
I got the "clean" response.text as I poked it into a JS alert box to see it...
so tried forcing it with a manual submit button using some nonense text - wil not change
built a super simple change with a manual submit button - works!
Thanks in advance from me and my skull with a new flat spot,
GREG...
-----
WORKS ON THIS PAGE <simple_test.ht m>:
[CODE=html]
<html>
<head>
<script type="text/javascript">
function changeText() {
document.getEle mentById('site_ info').innerHTM L = 'Fred Flinstone';
}
</script>
</head>
<body>
<p>
Welcome to the site <b id='juicy_text' >dude</b>
</p>
<input type='button' onclick='change Text()' value='Change Text'/>
</body>
</html>[/CODE]
-------------
DOESN'T WORK ON THIS PAGE - <test.php>
[CODE=html]<html>
<head>
<title>Try Adjusting based on Selection and PostgreSQL connection</title>
<script language="JavaS cript" src="select_sit e.js"></script> //not included as irrevalant for this forced test
<script type="text/javascript">
function fun_manual_chan ge_text() {
document.getEle mentById('juicy _text').innerHT ML = 'Fred Flinstone';
}
</script>
</head>
<body>
<?php
//set up the PostgreSQL database connection used throughout
$db_connect=pg_ connect("host=[munge] dbname=[munge] user=[munge] password=[munge]") or die(pg_last_err or($db_conn));
//SUM of SITE data for analytical data showing on web page
$SQL_Query = " SELECT site_id, site_id_abrev
FROM d_site
WHERE country<>'NA'
ORDER BY site_id
";
$query_result=p g_query($db_con nect, $SQL_Query);
$counter=0;
while($row_data =pg_fetch_array ($query_result) ) {
$counter+=1;
$ary_sites[$counter] = $row_data["site_id"];
$ary_abbrevs[$counter] = $row_data["site_id_ab rev"];
}
?>
<h2 align="center" style="color:gr een">Try AJAX with Strathmore Data out of PostgreSQL</h2>
<form>
<b>Select a Site:</b><br />
<select name="sites" onchange="fun_g et_site_details (this.value)">
<?php
$counter=0;
foreach($ary_si tes as $dummy) {
$counter+=1;
print "<option value=\"".$ary_ abbrevs[$counter]."\">".$ary_sit es[$counter]."</option>";
}
?>
</select>
<br />
<br />
<input type='button' onclick='fun_ma nual_change_tex t' value='Change Text Manually'/>
</form>
<br />
<br />
<p>
<b>Site Info.:</b><br />
<div id='site_info'>
Some info for the selected site will be listed here...
</div>
</p>
</body>
</html>[/CODE]
Comment