
Originally Posted by
jscheuer1
OK, the easiest way would be to reload the page.
Well, this is for an RPG game. I already have a page version that is 100% php which works by reloading frames. The reason I want to do it via JS is to avoid loading all of the code and images every time they click on the page in order to speed the game up from the player's perspective and reduce bandwidth (and lag) from mine.

Originally Posted by
jscheuer1
Since you appear to be depending upon javascript here, why not just have whatever changes the server side value also change it on the client side? And, you should realize (if you don't already) that depending upon javascript for anything that involves the server side is potentially both insecure and unreliable. First because javascript can be altered by the client, and second because the client may not have javascript enabled.
Yes. I understand. If they have javascript disabled then they will be directed to the 100% php version.
What I have so far is this:
Code:
<script type='text/javascript' /><!--
function IncludeJavaScript(jsFile)
{
document.write('<script type="text/javascript" src="'
+ jsFile + '"></script>');
}
//--></script>
<a onclick="IncludeJavaScript('index2.script1.php?msg=Hi')">Hi</a>
<a onclick="IncludeJavaScript('index2.script1.php?msg=Bye')">Bye</a>
index2.script1.php just contains an alert that displays $msg.
The problem is that when I click on the text the alert comes up but the page also goes white like it's reloading.
Bookmarks