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: wheresrhys@gmail.com Owned by: wheresrhys@gmail.com
Priority: low Milestone: None
Component: ajax Version: 1.6.4
Keywords: Cc:
Blocked by: Blocking:
Description

$.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

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: → wheresrhys@gmail.com
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 http://jsfiddle.net/wheresrhys/dggAB/#base 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

http://jsfiddle.net/3ECcM/

Use type instead of method. Works for me.