Connecting Tech Pros Worldwide Help | Site Map

Browser Refresh needed for .js and HTML??

  #1  
Old September 30th, 2005, 07:25 AM
milkyway
Guest
 
Posts: n/a
Hello to all ;-)

I am using the Visual Studio 2005 .NET framework.

Basically, I have file that is served up as an HTML file on the client
side (generated from a .aspx file). But - the HTML file is using
javascript to implement a button click (on the client side).

Ex:
<INPUT onclick="alert('about to start'); process_table('FrmX1',
'FDepents'); " type="button" value="SAVE" >

Well, whenever I make changes to the file called "row_functions.js"
(the file containing the function "process_table"), I find that I need
to hit the "Refresh" button in the browser (Internet Explorer) in order
for the changes to be recognized.

Is there a way to make sure that the browser refreshes my .js file
automatically? In other words, when I make changes to the .js file, it
would be nice not to hit the browser "Refresh" button - sometimes, I
forget to do so ;-(

What happens for regular developers if they have a *lot* of clients to
serve? Does a change in a .js file mean that you have to contact all
those clients to tell them to hit the "refresh" button in their
browsers?

TIA

  #2  
Old September 30th, 2005, 09:25 PM
Raul Macias
Guest
 
Posts: n/a

re: Browser Refresh needed for .js and HTML??


Check your browser cache settings. I assume you are using IE. See what you
have in the
"Check for newer version of stored pages" option.

"milkyway" <d0mufasa@hotmail.com> wrote in message
news:1128060906.753056.94390@g44g2000cwa.googlegro ups.com...[color=blue]
> Hello to all ;-)
>
> I am using the Visual Studio 2005 .NET framework.
>
> Basically, I have file that is served up as an HTML file on the client
> side (generated from a .aspx file). But - the HTML file is using
> javascript to implement a button click (on the client side).
>
> Ex:
> <INPUT onclick="alert('about to start'); process_table('FrmX1',
> 'FDepents'); " type="button" value="SAVE" >
>
> Well, whenever I make changes to the file called "row_functions.js"
> (the file containing the function "process_table"), I find that I need
> to hit the "Refresh" button in the browser (Internet Explorer) in order
> for the changes to be recognized.
>
> Is there a way to make sure that the browser refreshes my .js file
> automatically? In other words, when I make changes to the .js file, it
> would be nice not to hit the browser "Refresh" button - sometimes, I
> forget to do so ;-(
>
> What happens for regular developers if they have a *lot* of clients to
> serve? Does a change in a .js file mean that you have to contact all
> those clients to tell them to hit the "refresh" button in their
> browsers?
>
> TIA
>[/color]


  #3  
Old October 1st, 2005, 08:15 AM
milkyway
Guest
 
Posts: n/a

re: Browser Refresh needed for .js and HTML??


Thank you again for the reply ;-)

But where can I find this setting? Also, what do developers do if there
is change in a .js file and it has to be distributed to many front
ends? I was wondering ...


Raul Macias wrote:[color=blue]
> Check your browser cache settings. I assume you are using IE. See what you
> have in the
> "Check for newer version of stored pages" option.
>
> "milkyway" <d0mufasa@hotmail.com> wrote in message
> news:1128060906.753056.94390@g44g2000cwa.googlegro ups.com...[color=green]
> > Hello to all ;-)
> >
> > I am using the Visual Studio 2005 .NET framework.
> >
> > Basically, I have file that is served up as an HTML file on the client
> > side (generated from a .aspx file). But - the HTML file is using
> > javascript to implement a button click (on the client side).
> >
> > Ex:
> > <INPUT onclick="alert('about to start'); process_table('FrmX1',
> > 'FDepents'); " type="button" value="SAVE" >
> >
> > Well, whenever I make changes to the file called "row_functions.js"
> > (the file containing the function "process_table"), I find that I need
> > to hit the "Refresh" button in the browser (Internet Explorer) in order
> > for the changes to be recognized.
> >
> > Is there a way to make sure that the browser refreshes my .js file
> > automatically? In other words, when I make changes to the .js file, it
> > would be nice not to hit the browser "Refresh" button - sometimes, I
> > forget to do so ;-(
> >
> > What happens for regular developers if they have a *lot* of clients to
> > serve? Does a change in a .js file mean that you have to contact all
> > those clients to tell them to hit the "refresh" button in their
> > browsers?
> >
> > TIA
> >[/color][/color]

  #4  
Old October 1st, 2005, 08:25 AM
Clarke Scott
Guest
 
Posts: n/a

re: Browser Refresh needed for .js and HTML??


What is it that you are trying to do in the function?
It may be a better idea it process this server side in an event in your cde
behind file?

At way you wont have the issues of cached .js files.

Or the other option would be to remove the javascript finction from the .js
file and place that code in the Form1.aspx page .

HTH

Clarke Scott

"milkyway" <d0mufasa@hotmail.com> wrote in message
news:1128060906.753056.94390@g44g2000cwa.googlegro ups.com...[color=blue]
> Hello to all ;-)
>
> I am using the Visual Studio 2005 .NET framework.
>
> Basically, I have file that is served up as an HTML file on the client
> side (generated from a .aspx file). But - the HTML file is using
> javascript to implement a button click (on the client side).
>
> Ex:
> <INPUT onclick="alert('about to start'); process_table('FrmX1',
> 'FDepents'); " type="button" value="SAVE" >
>
> Well, whenever I make changes to the file called "row_functions.js"
> (the file containing the function "process_table"), I find that I need
> to hit the "Refresh" button in the browser (Internet Explorer) in order
> for the changes to be recognized.
>
> Is there a way to make sure that the browser refreshes my .js file
> automatically? In other words, when I make changes to the .js file, it
> would be nice not to hit the browser "Refresh" button - sometimes, I
> forget to do so ;-(
>
> What happens for regular developers if they have a *lot* of clients to
> serve? Does a change in a .js file mean that you have to contact all
> those clients to tell them to hit the "refresh" button in their
> browsers?
>
> TIA
>[/color]


  #5  
Old October 1st, 2005, 07:25 PM
Jambalaya
Guest
 
Posts: n/a

re: Browser Refresh needed for .js and HTML??


You could try the old random number trick in the aspx file. Code a
random number to be appended to the end of the js file src string in
the html output. So you would end up with this in the html:

<SCRIPT TYPE="text/javascript"
SRC="row_functions.js?nocache=109435987234">

  #6  
Old October 1st, 2005, 09:45 PM
milkyway
Guest
 
Posts: n/a

re: Browser Refresh needed for .js and HTML??


Hi Clarke - and thanks ;-)

Clarke Scott wrote:[color=blue]
> What is it that you are trying to do in the function?[/color]
I am doing checks (using regular expression) of the data entered on the
HTML page. It was my understanding that user-entry checks should happen
on the client side so as to prevent so much hitting on the server.
[color=blue]
> It may be a better idea it process this server side in an event in your cde
> behind file?[/color]
The code is being used in several .HTML files. So, I placed all data
checks into one file (the .js) and import it into each HTML file being
used.

  #7  
Old October 1st, 2005, 09:45 PM
milkyway
Guest
 
Posts: n/a

re: Browser Refresh needed for .js and HTML??


Thanks for the help Jamba but where does the 109435987234 number come
from and what does the attribute "nocache" do in this case?

Jambalaya wrote:[color=blue]
> You could try the old random number trick in the aspx file. Code a
> random number to be appended to the end of the js file src string in
> the html output. So you would end up with this in the html:
>
> <SCRIPT TYPE="text/javascript"
> SRC="row_functions.js?nocache=109435987234">[/color]

  #8  
Old October 3rd, 2005, 12:55 AM
Jambalaya
Guest
 
Posts: n/a

re: Browser Refresh needed for .js and HTML??


>>You could try the old random number trick in the[color=blue][color=green]
>>aspx file. Code a random number to be appended
>>to the end of the js file src string in the html output.
>>So you would end up with this in the html:
>><SCRIPT TYPE="text/javascript"
>>SRC="row_functions.js?nocache=109435987234">[/color]
>
>Thanks for the help Jamba but where does the
>109435987234 number come from and what
>does the attribute "nocache" do in this case?[/color]

The number is a random number that you generate every time the page is
served. The attribute does nothing other than trick the browser into
thinking that the .js file must be retrieved every time instead of
cached. It didn't have to be called "nocache"; it could have been
"?MilkywayWuzHere=468735168576511"...

Closed Thread


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loading js file dynamically max@kipness.com answers 4 June 27th, 2006 01:05 AM
idea needed: Longrunning PHP-script/continious stream/browser 'pagerenew' Erwin Moller answers 3 March 31st, 2006 02:35 PM
Browser Refresh needed for .js and HTML?? milkyway answers 7 November 19th, 2005 08:29 PM
Options for real-time plotting of server-side data? Russ answers 12 October 21st, 2005 12:36 AM