Jump to content

Ajax not refreshing?


erfg1

Recommended Posts

Why does this not refresh when I click on the links?

 

<script type="text/javascript">
function refreshDiv2() { 
$("#load2div").load("./zones/<?PHP echo $charinfo[9]; ?>.php?char=<?PHP echo $_GET["char"]; ?>&x=<?PHP echo rand; ?>"); 
}

var refreshId = setTimeout(refreshDiv2, 800);
</script>

 

<div id="load2div"></div>

 

 

Zone file:

<?PHP session_start(); if ($_SESSION['zone'] == "Untitled-1") { ?>
<img name="Untitled1" src="./zones/Untitled-1.jpg" width="675" height="494" border="0" id="Untitled1" usemap="#m_Untitled1" alt="" /><map name="m_Untitled1" id="m_Untitled1">
<area shape="rect" coords="562,222,675,494" href="w2.php?char=<?PHP echo $_GET["char"]; ?>&m=Lets check out the right area…&z=Untitled-right" alt="" target="hiddenframe"/>
<area shape="rect" coords="0,302,138,494" href="w2.php?char=<?PHP echo $_GET["char"]; ?>&m=Lets check out this left area…&z=Untitled-left" alt="" target="hiddenframe"/>
</map>
<?PHP } else { echo "ERROR: Please refresh this page."; exit; } ?>

Link to comment
https://forums.phpfreaks.com/topic/227627-ajax-not-refreshing/
Share on other sites

How about instead, how do I change the div of the parent frame from the iframe?

 

<script type="text/javascript">
		$("#load2div").load("./zones/<?PHP echo $charinfo[9]; ?>.php?char=<?PHP echo $_GET["char"]; ?>&x=<?PHP echo rand; ?>"); 
	</script>

Wont do it alone obviously, it needs to be pointing to the parent file.

Link to comment
https://forums.phpfreaks.com/topic/227627-ajax-not-refreshing/#findComment-1174159
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.