views:

24

answers:

2

I'm trying to edit an aspx page...mainly javascript, and I randomly see changes that I've made when refreshing.

I'm using jquery, but I'm not sure that jquery is the culprit here.

For example. If I add a simple alert("hello"); in the page I'm calling, I do not see it take place until I have cleared all my temp files and cache, closed my browser opened back up...and even then, sometimes, I still don't see my changes.

Any ideas?

+1  A: 

Do a Ctrl+F5 to force a full refresh, this will make your scripts reload. IE likes to hold onto things...usually in a way that doesn't make any sense of obey any rules.

Alternatively, set no cache on the server, like this:

Response.Cache.SetCacheability(HttpCacheability.NoCache);

Or in the head of the page html, like this:

<meta http-equiv="pragma" content="no-cache"/>
Nick Craver
it doesn't. I've tried. It is the strangest thing. I added a simple "hello" in the body tag and that doesn't even show up. And yes....I am editing the right file and opening up the right file in my browser.
Senica Gonzalez
@Senica - You have cache headers being set correctly from the server, or a `<meta>` tag in the page?
Nick Craver
Do you have any cache-control directives in the HTTP Headers for scripts or image files?
desigeek
I went ahead and added the meta tag for no cache in my head. Still not working. Even a simple edit like adding test to the page does not show up. I think perhaps a server issue of some sort...?
Senica Gonzalez
@Senica - Can you confirm with fiddler or Firefox/firebug that it is indeed a cache issue on the client? perhaps you have output caching turned on?
Nick Craver
A: 

you can do several things that will help you to find the issue

  1. Using Firebug Check for any JavaScript errors
  2. To be sure of using the same file hit Ctrl + A to select all and then hit Del, save the file and check if page is empty.
  3. Hit Ctrl + F5 to refresh browsers cache
  4. Dont use alert("something") to debug, you can use a debugger; line with FireBug.
GerManson