DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: AJAX problems with opener.document

  1. #1
    Join Date
    Apr 2007
    Posts
    2

    AJAX problems with opener.document

    Hey AJAX gurus!

    I have a load of AJAX in some complicated forms. We have lots of list boxes, and rather than populate them all with all of the options, we have the values in the table and an onClick() which fires a request for the values as needed. This works fine everywhere.

    But...

    Recently we have added a new table that is the parent to a child table whose children feed a dropdown with a 'Go' button alongside it. When clicking the 'go' a second window opens for editing of the child record. All of this works fine as well.

    But...

    At the end (after a 'save') on the secondary window, I end with the window having a single button that says 'Close Window'. When the user clicks this, it fires a derivation of the original AJAX populating function (only with 'opener' added to the 'document.GetElementbyID' function). This works fine in Firefox, but in Explorer it breaks!

    For some reason, there seems to be a DOM difference between a 'self' window and an 'opener' window -- at least as it pertains to dropdowns.

    Here is the code, and here's what breaks:
    NOTE: What I do here is feed back the list with a bar separator ("|") and then split it up. Again, this works FINE with the 'self' window. Also, all of these platform 'IFs' are new, I never needed them before on the original ('self') version of this. HELP!!!! TIA!

    -- John Kiernan

    response = req.responseText;
    var d = new Array();
    d = response.split('|');
    if (is_ie5up) {
    } else {
    opentarget.length=0;
    }
    if (d.length > 0) {
    for (i=0; i < d.length; i++) {
    opttext = d[i];
    optvalue = d[i];
    if (is_ie5up) {
    opentarget.options[i] = opttext;
    } else {
    opentarget.options[i] = new Option(opttext,optvalue );
    }
    }
    } else {
    if (is_ie5up) {
    opentarget.options[i] = "No Values";
    } else {
    opentarget.options[0] = new Option("No Values","");
    }
    }

  2. #2
    Join Date
    Apr 2007
    Location
    Sunny Adelaide
    Posts
    13
    Hi John,

    I strongly suggest that, instead of opening a window, you create a popup div element instead. These are far easier to manage and you won't run into any security/popup-blocker issues.

    I am not sure what the code you have posted does.

    Regards,

    - p
    Brevitywit

Similar Threads

  1. A new AJAX IDE !
    By ajaxtoday in forum AJAX
    Replies: 3
    Last Post: 04-11-2007, 01:40 AM
  2. Ajax: Working in IE but not Mozilla?
    By MarkMac in forum AJAX
    Replies: 0
    Last Post: 03-15-2007, 04:41 AM
  3. Replies: 3
    Last Post: 09-12-2006, 02:31 AM
  4. Basic AJAX examples
    By Frefaln in forum AJAX
    Replies: 2
    Last Post: 06-03-2006, 07:45 PM
  5. New forum + some AJAX links
    By Lori in forum AJAX
    Replies: 0
    Last Post: 02-09-2006, 02:26 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center