Hi All hope you can help its been driving me crazy .. i have a website where i change the content of a div using jquery, however i also want to change the background image at the same time but cant seem to get both to work together, not sure what im doing wriong but i think its something to do with the script and return false
you can also view the page here
http://www.prototype202.com/index_test.html
button1 changes bg image ok
button 2 changes div content ok
button 3 doesnt work
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3c.org/TR/1999/REC-html401-19991224/loose.dtd">
<HTML xmlns="http://www.w3.org/1999/xhtml">
<HEAD>
<TITLE></TITLE>
<META content="text/html; charset=UTF-8" http-equiv=Content-Type><LINK rel=stylesheet type=text/css href="css/style.css">
<META name=GENERATOR content="MSHTML 8.00.6001.18928">
<SCRIPT language="JavaScript" SRC="js/jquery-1.4.2.js"></SCRIPT>
<script type="text/javascript">
function ahah(url, target) {
document.getElementById(target).innerHTML = ' ';
if (window.XMLHttpRequest) {
req = new XMLHttpRequest();
} else if (window.ActiveXObject) {
req = new ActiveXObject("Microsoft.XMLHTTP");
}
if (req != undefined) {
req.onreadystatechange = function() {ahahDone(url, target);};
req.open("GET", url, true);
req.send("");
}
}
function ahahDone(url, target) {
if (req.readyState == 4) { // only if req is "loaded"
if (req.status == 200) { // only if "OK"
document.getElementById(target).innerHTML = req.responseText;
} else {
document.getElementById(target).innerHTML=" AHAH Error:\n"+ req.status + "\n" +req.statusText;
}
}
}
function load(name, div) {
ahah(name,div);
return false;
}
</script>
</HEAD>
<BODY id=page-body>
<DIV id=bg>
<DIV>
<TABLE cellSpacing=0 cellPadding=0>
<TBODY>
<TR>
<TD> <span id=bg_image><img alt="" src="/images/june.jpg"></span> </TD>
</TR></TBODY></TABLE></DIV></DIV>
<DIV id=prototype>
<table width="518" border="0" cellpadding="0" cellspacing="1" class="bgmain">
<tr>
<td valign="top"><table width="518" border="0" cellpadding="0" cellspacing="0" class="tablebodytext">
<tr class="tablebodytext">
<td height="10" class="tablebodytext"><div align="center"><a href="feb2010.html" onclick="load('bg_feb.html','bg_image');return false;"><img src="images/trklist.png" alt="button1" width="15" height="15" border="0"></a></div></td>
</tr>
<tr class="tablebodytext">
<td height="10" class="tablebodytext"><div align="center"><a href="feb2010.html" onclick="load('tracklists/feb2010.html','prototype_trk');return false"><img src="images/trklist.png" alt="button2" width="15" height="15" border="0"></a></div></td>
</tr>
<tr class="tablebodytext">
<td height="10" class="tablebodytext"><div align="center"><a href="mar2010.html" onclick="load('tracklists/mar2010.html','prototype_trk');return false;" "load('bg_feb.html','bg_image');return false;"><img src="images/trklist.png" alt="button3" width="15" height="15" border="0"></a></div></td>
</tr>
</table></td>
</tr>
</table>
</DIV>
<div id="prototype_trk">
</BODY></HTML>