Problems reloading same page with new parameters

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • TomDestry
    New Member
    • May 2007
    • 2

    Problems reloading same page with new parameters

    I have a web page and lots of XML files. When a link is clicked on the page, it calls a function via onclick with the XML file as a parameter:

    [HTML]<body onload="InitCon tent();">
    <a name="fileName" class="blah" href="javascrip t: void(0)" onclick="OpenCo lumnInfo('fileN ame')">Whatever </a>
    </body>[/HTML]
    OpenColumnInfo( ) takes the filename and reads in the relevant XML then squirts the contents into various tags on the current page, so there is no reload. This works fine, but the browser navigation buttons obviously don't change.

    In an effort to get the back button working I thought I could just change OpenColumnInfo( ) to reload the page by calling one of:

    Code:
    window.open(http://www/etc/page.htm?fileName, "_self")
    window.location.href = "http://www/etc/page.htm?fileName"
    I also changed the link to set href="".

    However, when InitContent() is called by the reload, I notice that window.location .href = http://www/etc/ so it loses the htm filename and the parameter. I found it did sort of work with:

    Code:
    window.open(http://www/etc/page.htm?fileName)
    In the sense that the new window was correct, but the old window also reloaded only with no parameters, so it lost what had been there. Anyway, I need it to stay in a single window.

    Curiously, I note that if I remove the attribute href="" completely, then it does work, but the pointer no longer changes to a hand when over a link.

    I'm currently working on IE7.0, though it will need to work on IE6.0 also.

    Can anyone explain where I'm going wrong?
  • dmjpro
    Top Contributor
    • Jan 2007
    • 2476

    #2
    Originally posted by TomDestry
    I have a web page and lots of XML files. When a link is clicked on the page, it calls a function via onclick with the XML file as a parameter:

    [HTML]<body onload="InitCon tent();">
    <a name="fileName" class="blah" href="javascrip t: void(0)" onclick="OpenCo lumnInfo('fileN ame')">Whatever </a>
    </body>[/HTML]
    OpenColumnInfo( ) takes the filename and reads in the relevant XML then squirts the contents into various tags on the current page, so there is no reload. This works fine, but the browser navigation buttons obviously don't change.

    In an effort to get the back button working I thought I could just change OpenColumnInfo( ) to reload the page by calling one of:

    Code:
    window.open(http://www/etc/page.htm?fileName, "_self")
    window.location.href = "http://www/etc/page.htm?fileName"
    I also changed the link to set href="".

    However, when InitContent() is called by the reload, I notice that window.location .href = http://www/etc/ so it loses the htm filename and the parameter. I found it did sort of work with:

    Code:
    window.open(http://www/etc/page.htm?fileName)
    In the sense that the new window was correct, but the old window also reloaded only with no parameters, so it lost what had been there. Anyway, I need it to stay in a single window.

    Curiously, I note that if I remove the attribute href="" completely, then it does work, but the pointer no longer changes to a hand when over a link.

    I'm currently working on IE7.0, though it will need to work on IE6.0 also.

    Can anyone explain where I'm going wrong?

    i don't understand http://www/etc/page.htm?fileNa me....

    Comment

    • TomDestry
      New Member
      • May 2007
      • 2

      #3
      That's just my simplified description of the url. Is it my forgetting to add the quotes that's confusing?

      The actual line is:

      Code:
      window.open("http://localhost:50847/ColumnHelp/default.htm?Column=MVGrossDelta", "_self");

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        What does InitContent do?

        Comment

        • dmjpro
          Top Contributor
          • Jan 2007
          • 2476

          #5
          Does HTML can generate a dynamic web-page????

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Originally posted by dmjpro
            Does HTML can generate a dynamic web-page????
            Using javascript, yes.

            Comment

            • dmjpro
              Top Contributor
              • Jan 2007
              • 2476

              #7
              ACODER i think u misunderstood me.....

              i mean to say .... is it a valid URL ....
              localhost:50847/ColumnHelp/default.htm?Col umn=MVGrossDelt a

              soryy ......
              plz forgive me if anything wrong with my attitude.

              kind regards.
              dmjpro.

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                Using the search property, it is possible to work with the query strings.

                Comment

                Working...