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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.