Browser Refresh needed for .js and HTML??

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • milkyway

    Browser Refresh needed for .js and HTML??

    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

  • Raul Macias

    #2
    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@hotma il.com> wrote in message
    news:1128060906 .753056.94390@g 44g2000cwa.goog legroups.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]


    Comment

    • milkyway

      #3
      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@hotma il.com> wrote in message
      > news:1128060906 .753056.94390@g 44g2000cwa.goog legroups.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]

      Comment

      • Clarke Scott

        #4
        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@hotma il.com> wrote in message
        news:1128060906 .753056.94390@g 44g2000cwa.goog legroups.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]


        Comment

        • Jambalaya

          #5
          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_functi ons.js?nocache= 109435987234">

          Comment

          • milkyway

            #6
            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.

            Comment

            • milkyway

              #7
              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_functi ons.js?nocache= 109435987234">[/color]

              Comment

              • Jambalaya

                #8
                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_func tions.js?nocach e=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
                "?MilkywayWuzHe re=468735168576 511"...

                Comment

                Working...