Skip to main content

Bug Tracker

Side navigation

#10518 closed bug (worksforme)

Opened October 18, 2011 08:13AM UTC

Closed October 18, 2011 05:09PM UTC

HTML comments break when() then()

Reported by: Owned by:
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 - - but struggling with getting the ajax API to return anything at all

Attachments (0)
Change History (4)

Changed October 18, 2011 08:20AM UTC by anonymous comment:1

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

Changed October 18, 2011 09:40AM UTC by addyosmani comment:2

component: unfiledajax
owner: →
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?

Changed October 18, 2011 02:06PM UTC by anonymous comment:3

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 aside from that I can't get the echo/html API to work.

Changed October 18, 2011 05:09PM UTC by jaubourg comment:4

resolution: → worksforme
status: pendingclosed

Use type instead of method. Works for me.