2
I’m having trouble applying the following Javascript code to my platform:
<script>
var $scores = $("#refresh");
setInterval(function() {
$scores.load("index.php #refresh");
}, 30000);
</script>
Because the <div>
in question is in a separate file and I include
of it on all pages or I will never know which page the script will run on and in the code above I have to specify a page ex: index.php
What doesn’t work? Can you describe the problem?
– Sergio
The problem is that since I don’t know what page I’ll be on, scricpt never runs because I have to tell you what the current page is, as you can see in the code
load("index.php #refresh");
– user26776
:/ I haven’t figured it out yet. This string you pass to . load() should be different depending on which page it’s on?
– Sergio
yes where this
index.php
must be the name of the page point its extension– user26776
You can give an example of how the page urls are ?
– Sergio
for example
home.php
,avisos.php
– user26776