KoE Posted October 24, 2006 Report Share Posted October 24, 2006 I have absolutely no knowledge of Javascript, and am in need of assistance. I am using the script from the following link: http://www.dynamicdrive.com/dynamicindex17/ajaxcontent.htm Anyway the problem is I have a working 404 error page setup. But it doesnt work for the div in which the javascript is loading pages to. If it can't find the page it just doesnt do anything. Any help would be much appreciated. Link to comment Share on other sites More sharing options...
Smidge204 Posted October 24, 2006 Report Share Posted October 24, 2006 Do you have a custom 404 page or does the server generate its own? =Smidge= Link to comment Share on other sites More sharing options...
KoE Posted October 24, 2006 Author Report Share Posted October 24, 2006 Its a custom one. Link to comment Share on other sites More sharing options...
Smidge204 Posted October 24, 2006 Report Share Posted October 24, 2006 Forgive me for not wanting to pick apart this code too much, but from what little I know of AJAX I believe the problem lies here: function loadpage(page_request, containerid){ if (page_request.readyState == 4 [b][COLOR="Red"]&& (page_request.status==200 || window.location.href.indexOf("http")==-1)[/COLOR][/b]) document.getElementById(containerid).innerHTML=page_request.responseText } Emphasis mine. Try removing the code I highlighted and see if ti works. =Smidge= Link to comment Share on other sites More sharing options...
KoE Posted October 24, 2006 Author Report Share Posted October 24, 2006 That did the trick! Thanks Smidge! Link to comment Share on other sites More sharing options...
Koray Posted October 24, 2006 Report Share Posted October 24, 2006 lolo. It's technically invalid now. Link to comment Share on other sites More sharing options...
KoE Posted October 24, 2006 Author Report Share Posted October 24, 2006 lolo. It's technically invalid now. Care to Explain? Link to comment Share on other sites More sharing options...
Smidge204 Posted October 24, 2006 Report Share Posted October 24, 2006 Koray is one of those people who preach 100% conformance with published standards, even when doing so doesn't get things working the way you need them to. Standards are good and all, but sometimes you have to be different. =Smidge= Link to comment Share on other sites More sharing options...
KoE Posted October 24, 2006 Author Report Share Posted October 24, 2006 ah right... i thought he was gonna claim it would cause other problems. Link to comment Share on other sites More sharing options...
VectorSatyr Posted October 24, 2006 Report Share Posted October 24, 2006 Koray is one of those people who preach 100% conformance with published standards, even when doing so doesn't get things working the way you need them to. Silly as it is sometimes, it's important in the eyes of major business publishers. Invalid code shows either laziness or carelessness towards your personal webpage, whether you think so or not. Link to comment Share on other sites More sharing options...
Smidge204 Posted October 24, 2006 Report Share Posted October 24, 2006 So comment your code to explain why you did it that way. No need to be ashamed of creative problem solving. =Smidge= Link to comment Share on other sites More sharing options...
Recommended Posts