PDA

View Full Version : Dynamic load content with AJAX does not work offline in the new IEXPLORER?



Michealnl
12-12-2006, 01:54 PM
1) Problem loading content with newest IEXPLORER 7

2) http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.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_java/ajaxfiles/external3.html

Can anyone please help me out with this problem?

jscheuer1
12-12-2006, 03:46 PM
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/showthread.php?p=52616#post52616

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

ddadmin
12-12-2006, 09:37 PM
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/showthread.php?t=15222

Michealnl
12-18-2006, 09:39 AM
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.

jscheuer1
12-18-2006, 02:23 PM
I'm not fully clear on what you are trying to do. However, when pollC fires, comments (green) will never be executed:


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:


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.

Michealnl
12-19-2006, 10:58 AM
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

jscheuer1
12-19-2006, 04:06 PM
That's what startList does:


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", "");
}
}
}
}
}

Michealnl
12-20-2006, 11:00 AM
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/paginas/contactform_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,

jscheuer1
12-20-2006, 03:54 PM
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.

Michealnl
12-21-2006, 11:59 AM
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.

jscheuer1
12-21-2006, 08:57 PM
I think that is a sort of display bleed through from the Flash content. The Flash continues to be slightly animated even after the page has loaded. Once again, this is different in different browsers. There may be settings or techniques in Flash to avoid this (certainly stopping the animation effects after the header is loaded should do it). I get the sense that in IE 7 this is causing the cursor in the form to blink more than it otherwise would. Also in that browser, there is no top margin and a bit of the Flash header is cut off.

Michealnl
12-22-2006, 08:06 PM
I thought it fanaly worked, but i tested this in Firefox.
It does not work in IEXPLORER 6.0. I still can't figure out why
it get's in a loop when entering an e-mail adres. Even when it is a valid one.
I also validated the contact page, and it turned green and passed the
html validation.

It does not make any sense, because i used this e-mail script many times.
Only trough the ajax script it causes this strange problem?

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