Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When will this happen?

Tags:

html

scripting

<script type="text/javascript" src="test.php"></script>

The first time I visit that page,test.php is not visited,

but if I refresh the page,it'll get run.

Have you ever experienced this ?

like image 255
user198729 Avatar asked Jan 06 '10 06:01

user198729


People also ask

Will be happen or will happen?

it should be "what will be happening?" (future progressive form) that describes an ongoing or continuous action that will take place in the future. always used with "will be" or "shall be", with the verb form ending in 'ing'.

What will happen correct grammar?

When asking what has occurred in the past, we say, “What happened?” If we were to ask what will occur in the future, we would say, “What will happen?” And if we wanted to know what is occurring at the present moment, then we'd ask, “What is happening?” It is never proper grammar to say “What happen?”

What will happen in a sentence?

You never can tell what will happen. We never can tell what will happen. Who knows what will happen to us? He looks to see what will happen on the morrow.


2 Answers

It will happen when test.php is cached locally or remotely.

like image 102
Tor Valamo Avatar answered Oct 06 '22 01:10

Tor Valamo


As Tor and Silky said, it's most likely caused by the page being cached. If you have Firebug installed, open the "Net" tab when you go to the page and you might see it say "304 Not Modified" - this means it has been cached.

The easiest and most reliable way (in my experience) to stop a file being cached is to add a random query string to it:

<script type="text/javascript" src="test.php?_=46031535"></script>

You'll just have to change it on each page load (either on the server or client side).

Of course, if the caching headers are set up properly on the server, then this shouldn't be an issue, but I've always found this method to be easier.

like image 37
nickf Avatar answered Oct 06 '22 01:10

nickf