Bug Tracker

Opened 11 years ago

Closed 11 years ago

#10518 closed bug (worksforme)

HTML comments break when() then()

Reported by: [email protected] Owned by: [email protected]
Priority: low Milestone: None
Component: ajax Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:


$.when("/my/ajax/url.php").then(function(html) {

breaks if the html begins with a comment


I've tried to create a test case using jsFiddle - http://jsfiddle.net/wheresrhys/dggAB/#base - but struggling with getting the ajax API to return anything at all

Change History (4)

comment:1 Changed 11 years ago by anonymous

Just realised I shoudl've included an example of code that breaks when html begins with a comment, so:

$(html) doesn't build any DOM nodes

comment:2 Changed 11 years ago by addyosmani

Component: unfiledajax
Owner: set to [email protected]
Priority: undecidedlow
Status: newpending

You can mock ajax requests using jsFiddle by using '/echo/json/' or '/echo/jsonp/'. Could you let us know once you've updated it and is reproducing the issue you experienced?

comment:3 Changed 11 years ago by anonymous

But I've been trying to use the jsFiddle API for echo/html/ and it keeps on returning an empty string. The test case is set up at http://jsfiddle.net/wheresrhys/dggAB/#base aside from that I can't get the echo/html API to work.

comment:4 Changed 11 years ago by jaubourg

Resolution: worksforme
Status: pendingclosed


Use type instead of method. Works for me.

Note: See TracTickets for help on using tickets.