Skip to main content

Bug Tracker

Side navigation

#11201 closed bug (invalid)

Opened January 20, 2012 08:38PM UTC

Closed January 20, 2012 08:56PM UTC

Last modified January 20, 2012 08:56PM UTC

jQuery.ajax convert JSONP to HTML

Reported by: jeromecovington@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.7.1
Keywords: Cc:
Blocked by: Blocking:
Description

There is a short script that I have set up to attempt to fetch HTML cross domain, using jQuery.ajax in hopes of making a cross domain request using JSONP then converting the response to HTML.

View source at http://www.jeromecovington.com/convert.html

This would seem to be supported in the documentation for dataType at http://api.jquery.com/jQuery.ajax/

"...multiple, space-separated values: As of jQuery 1.5, jQuery can convert a dataType from what it received in the Content-Type header to what you require. For example, if you want a text response to be treated as XML, use "text xml" for the dataType. You can also make a JSONP request, have it received as text, and interpreted by jQuery as XML: "jsonp text xml." Similarly, a shorthand string such as "jsonp xml" will first attempt to convert from jsonp to xml, and, failing that, convert from jsonp to text, and then from text to xml."

However I am getting the following error logged in Chrome 16 Web Inspector:

"Uncaught SyntaxError: Unexpected token <"

I may be misinterpreting the documentation. Please advise.

Attachments (0)
Change History (2)

Changed January 20, 2012 08:56PM UTC by rwaldron comment:1

resolution: → invalid
status: newclosed

Changed January 20, 2012 08:56PM UTC by rwaldron comment:2

In the future, please use the forums for support http://forum.jquery.com/using-jquery