Originally Posted by Howard Rose
There is nothing (obvious) that is wrong with your code. The problem is is with Apple. There Safari browser does not support AJAX.
Who said so? Safari supports AJAX as all the other browsers.
And there are
some errors in the code
1. Doctype. All the HTML documents must bear a Doctype, other wise the interpreter will approximate (in quirks mode) the way it should run the codes.
No. Use the type (optional in HTML5)
3. It is better to write the complete HTML structure of a document, to avoid any troubles:
- doctype here -
4. document.write() is not a dynamic method. Use DOM methods or innerHTML
There is also a problem regarding the query passed to the request. If the query has special characters, the whole query should be encoded. See encodeURIComponent()
And, the last but not the least:
var url = "http://www.instamapper.com/
AJAX can not perform a request cross-domains (except for IE, and only if the HTML document runs locally, which means it is not cross-domain
). You might need a server-side proxy application for that.