PDA

View Full Version : Explorer error with ajaxtabs



yabot
02-16-2008, 11:29 AM
1) Script Title: DD Ajax Tabs

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/

3) Describe problem:
Have now implemented the (really good) Ajax Tabs on a prospect website. All works well in Firefox and Opera, but get an error when loading some content using IE (Internet Explorer) 6 and 7.
The MS Script Debugger tell me it's on this line in ajaxtabs.js:
> document.getElementById(divId).innerHTML=page_request.responseText;
and that the error is an "unknown runtime error".

My guess is that it is something in the page I'm trying to load that interferes with the ajaxtab-script, but have no further ideas...
To see the error live go to http://yabot.net/dev/3.nsf and perform a search from the top right search box...
Any help appreciated or just point me in the right direction.
/Mats

yabot
02-16-2008, 01:26 PM
Change the ddajaxtabs.loadpage to trap the IE error and have had some progress ;)
Still not a really pretty solution but with some more hours and your help (please) I'll get it right.

Ps. Can't we just make IE go away? :p



ddajaxtabs.loadpage=function(page_request, pageurl, tabinstance){
var divId=tabinstance.contentdivid
document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
try {
document.getElementById(divId).innerHTML=page_request.responseText;
}
catch (e) {
// IE fails unless we wrap the string in another element.
document.getElementById(divId).innerHTML="";
var parentElement = document.getElementById(divId);
var wrappingDiv = document.createElement('div');
wrappingDiv.innerHTML = page_request.responseText;
parentElement.appendChild(wrappingDiv);
}
ddajaxtabs.ajaxpageloadaction(pageurl, tabinstance);
}
}

yabot
02-16-2008, 03:53 PM
The above method work but then all my other scripts on that page doesn't kick in as the ajax-page is in an other place in the DOM.
Seems that IE has a problem with the form-tag...
Giving up for now:mad:

D10
05-18-2011, 01:54 PM
It worked for me Yabot.

Thanks for posting your solution.