Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. Javascript: window.open() problems

Javascript: window.open() problems

Scheduled Pinned Locked Moved Web Development
perlhelpjavascripthtmldatabase
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    lnong
    wrote on last edited by
    #1

    I have an HTML frameset page with 2 frames. In the left frame, I have a menu containing several buttons. For each button I have an "Onclick" event that calls the Javascript window.open() function. Basically, this function just loads the results of a Perl script (*.pl) into the right frame. For example, the button to add a customer calls: window.open("AddCustomerToDatabase.pl", "right frame"); I also have a "show all customers" button that loads another Perl script which will retrieve all customers from a database and display them in nice table on the screen. This script also loads into the right frame, replacing the existing content. The problem I have is that I notice that the window.open() function does not load a FRESH page. (Evidently, I dont see the IE status/progress bar at the bottom showing any activity). For example, first I click "show all customers" and I see a table with 4 customers. Then I click "add customer" which loads a form (into the same right frame) in which I fill out the new customer information, and then submit it. Then when I click "show all customers" again, I still see the same table with only 4 customers, and not 5. Only when I click IE's "refresh" button will the updated table be displayed. I am using MySQL database, and I am positive that the submitted customer info is updated in the database immediately when i clicked submit. (I have checked that). I find it weird that window.open() doesnt load a fresh page each time. It only loads a fresh page during that page's first load. Can someone suggest me a way to force a fresh load each time? I thought about using window.location = http://blahblahblah.pl, but then there is no way to specify the target frame. Please help. Thanks.

    R B L 3 Replies Last reply
    0
    • L lnong

      I have an HTML frameset page with 2 frames. In the left frame, I have a menu containing several buttons. For each button I have an "Onclick" event that calls the Javascript window.open() function. Basically, this function just loads the results of a Perl script (*.pl) into the right frame. For example, the button to add a customer calls: window.open("AddCustomerToDatabase.pl", "right frame"); I also have a "show all customers" button that loads another Perl script which will retrieve all customers from a database and display them in nice table on the screen. This script also loads into the right frame, replacing the existing content. The problem I have is that I notice that the window.open() function does not load a FRESH page. (Evidently, I dont see the IE status/progress bar at the bottom showing any activity). For example, first I click "show all customers" and I see a table with 4 customers. Then I click "add customer" which loads a form (into the same right frame) in which I fill out the new customer information, and then submit it. Then when I click "show all customers" again, I still see the same table with only 4 customers, and not 5. Only when I click IE's "refresh" button will the updated table be displayed. I am using MySQL database, and I am positive that the submitted customer info is updated in the database immediately when i clicked submit. (I have checked that). I find it weird that window.open() doesnt load a fresh page each time. It only loads a fresh page during that page's first load. Can someone suggest me a way to force a fresh load each time? I thought about using window.location = http://blahblahblah.pl, but then there is no way to specify the target frame. Please help. Thanks.

      R Offline
      R Offline
      Roger Wright
      wrote on last edited by
      #2

      It sounds as if IE is caching the content from the first page displayed, and when subsequent actions request a page by the same name it serves up the cached copy, rather than generating a new one. I'm not sure how you would do so in a frameset, but try turning off caching, or expiring the display page immediately.

      "The Lion shall lie down with the Lamb;
      but the Lamb will not get much sleep..."
      Lazarus Long

      1 Reply Last reply
      0
      • L lnong

        I have an HTML frameset page with 2 frames. In the left frame, I have a menu containing several buttons. For each button I have an "Onclick" event that calls the Javascript window.open() function. Basically, this function just loads the results of a Perl script (*.pl) into the right frame. For example, the button to add a customer calls: window.open("AddCustomerToDatabase.pl", "right frame"); I also have a "show all customers" button that loads another Perl script which will retrieve all customers from a database and display them in nice table on the screen. This script also loads into the right frame, replacing the existing content. The problem I have is that I notice that the window.open() function does not load a FRESH page. (Evidently, I dont see the IE status/progress bar at the bottom showing any activity). For example, first I click "show all customers" and I see a table with 4 customers. Then I click "add customer" which loads a form (into the same right frame) in which I fill out the new customer information, and then submit it. Then when I click "show all customers" again, I still see the same table with only 4 customers, and not 5. Only when I click IE's "refresh" button will the updated table be displayed. I am using MySQL database, and I am positive that the submitted customer info is updated in the database immediately when i clicked submit. (I have checked that). I find it weird that window.open() doesnt load a fresh page each time. It only loads a fresh page during that page's first load. Can someone suggest me a way to force a fresh load each time? I thought about using window.location = http://blahblahblah.pl, but then there is no way to specify the target frame. Please help. Thanks.

        B Offline
        B Offline
        basementman
        wrote on last edited by
        #3

        You can append a unique parameter to the end of your query string to force the browser to load a new copy. This parameter will most likely be ignored by your script. Example:

        // old call
        // window.open("AddCustomerToDatabase.pl", "right frame");

        var cURL = "AddCustomerToDatabase.pl";

        var dDate = new Date();
        cURL += "&RandomNumber=" + dDate.valueOf();

        window.open(cURL, "right frame");

        Although if working in an IE only environment, I prefer to call window.navigate() method of the frame that I want to load. Ex: window.parent.frames[1].navigate(cURL);  onwards and upwards...

        1 Reply Last reply
        0
        • L lnong

          I have an HTML frameset page with 2 frames. In the left frame, I have a menu containing several buttons. For each button I have an "Onclick" event that calls the Javascript window.open() function. Basically, this function just loads the results of a Perl script (*.pl) into the right frame. For example, the button to add a customer calls: window.open("AddCustomerToDatabase.pl", "right frame"); I also have a "show all customers" button that loads another Perl script which will retrieve all customers from a database and display them in nice table on the screen. This script also loads into the right frame, replacing the existing content. The problem I have is that I notice that the window.open() function does not load a FRESH page. (Evidently, I dont see the IE status/progress bar at the bottom showing any activity). For example, first I click "show all customers" and I see a table with 4 customers. Then I click "add customer" which loads a form (into the same right frame) in which I fill out the new customer information, and then submit it. Then when I click "show all customers" again, I still see the same table with only 4 customers, and not 5. Only when I click IE's "refresh" button will the updated table be displayed. I am using MySQL database, and I am positive that the submitted customer info is updated in the database immediately when i clicked submit. (I have checked that). I find it weird that window.open() doesnt load a fresh page each time. It only loads a fresh page during that page's first load. Can someone suggest me a way to force a fresh load each time? I thought about using window.location = http://blahblahblah.pl, but then there is no way to specify the target frame. Please help. Thanks.

          L Offline
          L Offline
          lnong
          wrote on last edited by
          #4

          Thanks roger. Changing my IE browser's settings so that it checks for new versions of stored pages on every visit to the page did the job. Thats a nice little trick, basementman. I'll remember it. And I might give it a try as well. Thanks.

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups