erfg1 Posted February 14, 2011 Share Posted February 14, 2011 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; } ?> Quote Link to comment Share on other sites More sharing options...
gristoi Posted February 14, 2011 Share Posted February 14, 2011 try changing var refreshId = setTimeout(refreshDiv2, 800); to var refreshId = setTimeout("refreshDiv2()", 800); Quote Link to comment Share on other sites More sharing options...
erfg1 Posted February 14, 2011 Author Share Posted February 14, 2011 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.