Page 1 of 2 12 LastLast
Results 1 to 10 of 12

Thread: Dynamic load content with AJAX does not work offline in the new IEXPLORER?

  1. #1
    Join Date
    Nov 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation Dynamic load content with AJAX does not work offline in the new IEXPLORER?

    1) Problem loading content with newest IEXPLORER 7

    2) http://www.dynamicdrive.com/dynamici...jaxcontent.htm

    3) Describe problem:

    I have discovered a new problem with the new IEXPLORER 7.

    Everything worked fine, but now if you test your website offline
    in the newest IEXPLORER 7 you will find out that the content does not
    work dynamically. If you upload it to an server that it still works.

    My second problem is that i can't seem to load a external page (with a form and a bit of javascript)
    to load in corretly. It looks like there is a conflict?
    And i don't know if it is possible to load a external page with javascript on this external page.?

    My test website is at:

    http://www.webdesign-cs.com/ajax_java/

    If you click on the thrid link (FORM) then my page external3.html
    should be loaden and it wont work.

    The page seperately works fine:
    http://www.webdesign-cs.com/ajax_jav...external3.html

    Can anyone please help me out with this problem?
    Last edited by Michealnl; 12-12-2006 at 02:00 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    With the exception of this IE 7 glitch (which really is no problem if the page works live), all of your questions have been covered several times already in these forums. Inserting a form with Ajax requires that the HTML for that form be written with strict adherence to valid format, otherwise the script cannot understand what you are telling it to write. Validate your external form page (external3.html) at:

    http://validator.w3.org/

    Scripts may be used with Ajax loaded content (not loaded on the external page) as described and demonstrated on the demo page using tooltip.js. However, if your script must run certain actions 'onload' more work is needed, see:

    http://www.dynamicdrive.com/forums/s...2616#post52616

    and others you would find by searching your topic before posting a new thread about it.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    Yep, and on the issue of IE7 not being able to run the Ajax demos when offline, please see my explanation here: http://www.dynamicdrive.com/forums/s...ad.php?t=15222

  4. #4
    Join Date
    Nov 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for the documentation, i have read it, but i don't
    know how to properly use the PollC funtion.
    For example the onload function that has to be triggerd is the
    startList(); (the dropdown menu script)

    But if i put this in the pollC function in stead of onloadfunct();
    then my contact page gets loaded only one second and then is
    replaced by my homepage.

    I have made a test to see what happens live.
    Can anyone take a look at it , if i am doing it the proper way?

    The contact page's gets loaded if you press the top button.

    http://www.webdesign-cs.com/ajaxwithform/ajaxtest.html

    Kind regards,
    Micheal.

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    I'm not fully clear on what you are trying to do. However, when pollC fires, comments (green) will never be executed:

    Code:
    function pollC(id, load){
    if (!load&&document.getElementById(id)){
    document.getElementById(id).id='';
    return;
    }
    else if (load&&document.getElementById(id)){
    if (id=='unique_1')  //optional
    //startList();  //required
    return;
    }
    else if (load&&!document.getElementById(id))
    setTimeout("pollC('"+id+"', 'load')", 60);
    }
    I think what you want is:

    Code:
    function pollC(id, load){
    if (!load&&document.getElementById(id)){
    document.getElementById(id).id='';
    return;
    }
    else if (load&&document.getElementById(id)){
    //if (id=='unique_1')  //optional
    startList();  //required
    return;
    }
    else if (load&&!document.getElementById(id))
    setTimeout("pollC('"+id+"', 'load')", 60);
    }
    If only one onload event is being spoofed and only one id is ever tested for, testing for the specific id(s) is not required. But, for the function that was onload to fire, it cannot be commented out.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Nov 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Hi,

    I tried to do what you suggested, but now if
    you click on the contact button the contact page is loaded for
    only one second then it's replaced again?

    Could there be a conflict with the dropdown javascript and the pollC?

    http://www.webdesign-cs.com/ajaxwithform/ajaxtest.html

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    That's what startList does:

    Code:
    startList = function() {
    	ajaxpage('paginas/home.html', 'tekstvlak');
    	if (document.all&&document.getElementById) {
    		navRoot = document.getElementById("nav");
    		for (i=0; i<navRoot.childNodes.length; i++) {
    			node = navRoot.childNodes[i];
    			if (node.nodeName=="LI") {
    				node.onmouseover=function() {
    					this.className+=" over";
    				}
    				node.onmouseout=function() {
    					this.className=this.className.replace(" over", "");
    				}
    			}
    		}
    	}
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Nov 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question The bigger picture to this problem..

    Allright.. here goes my very weird problem..

    I tried to clean the page as much as possible like in the above url.
    But to see the real problem in live action i am now posting the
    url of the complete website.

    http://www.webdesign-cs.com/marcsite/marcsite1.html

    If you press on the "contact" button the contacts page get's loaded.
    I made a test function call Alert me... just to see what happend with
    the PollC function.

    But the REAL problem is when you enter an valid e-mail adres
    for example info@test.com you get an allert message that
    this is NOT a valid e-mail adres.

    But the same page with the same code seperately that is not loaded
    dynamically trough ajax works just fine.
    The code i included is : contactform.js in the main website.This code is exactly the same
    as i put on the seperate contact page to test it.

    See sample at:
    http://www.webdesign-cs.com/marcsite...form_test.html

    So, what is causing this? I haven't got a clue and tried to solve this
    but after spending hours and hours ..i give up.

    Can anyone see what't causing this e-mail problem validation?

    Kind regards,

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Most likely, it is because your page at:

    http://www.webdesign-cs.com/marcsite/paginas/contactform.html

    isn't valid. When invalid HTML fetched via Ajax is parsed through the browser's innerHTML object (as is the case with this script), what the resulting generated code is in any given browser will vary. For example, in FF 1.5.0.9, the form acts as expected. In Opera 9.01, it does not. Validate your external page at:

    http://validator.w3.org/

    That may not be the only problem but, without a valid page to begin with, it will be very hard to tell. It has been found that, with forms especially, there can be problems loading invalid Ajax content. So, you have to fix that first. It might be the only problem.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    Nov 2006
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default thanx!

    I missed the form tag, and now it works fine.
    Thanks for the tip! I now only have to find out what's causing
    the cursor to blink in the forms so much.

    Kind regards,
    Micheal.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •