javascript - jQuery.ajax gives "TypeError: Cannot read property 'documentElement' of null" on server but not local -
I have a problem with my jQuery code, but local copy works fine as you can see that If you come on, the following error occurs in the AJAX call:
I have checked and re-uploaded and re-uploaded Everything that I can think of, the documentation said to make sure I am right MIME type was being sent, which I did not avail of. The offensive code is here:
function change page agx (new page, method) {if (method ! = "Replace") {window.location.hash = newPage;} NewPage = newPage.substring (1); // Remove the hash symbol title = "speller sit 1 dot com |" + Fix cass (newpage.releast (/ \ g , "& Gt;")); // Set the window title NewPage = "ajax /" + New page + ".html"; // Add route if (newpage == current page) {return; // current page To Do not load it from.} $ .ajax ({// jQuery makes me feel like a code ninja. Url: new page, datatype: "XML", success: function (data, status, xmlhttp) {renderPage (xmlhttp);}, error: function (xmlhttp, status, error) {warning (error); Renderpage (xmlhttp);}}); Document.title = Title; CurrentPage = newPage; }
It then renders in a div on the page. They are appearing on the previous URL in the page / user folders grabbing pages. Any support you can provide will be greatly appreciated!
An error has been placed with the AJAX call:
error: function (Xmlhttp, status, error) ...
Since you are expecting an XML data type, call url for "ajax / home.html" is a mime type "text / Html "will return you may want to completely leave the datatype for jQuery. Example:
$ Ajax ({// jQuery I feel like code ninja. Url: newPage, success: function (data, status, xmlhttp) {renderPage (xmlhttp)}}, error: function (xmlhttp, status, error) {warning ( Error); renderpage (xmlhttp);}});
You also have the following code, which is the warning () in appendCSS
which I think is for debugging ?:
function append css (filename) {warning (filename); AdInd ($ ("head") = ("filename +" 'type =' text / css' / & gt; if (filename! = Null) {$ ("name" = "extracts" ).);}}
Comments
Post a Comment