Bug Tracker

Opened 7 years ago

Closed 7 years ago

Last modified 7 years ago

#12353 closed bug (invalid)

deferred.done demo does not work on IE8

Reported by: mwmorris@… Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.0
Keywords: Cc: jaubourg
Blocked by: Blocking:

Description

Go to deferred.done page on jQuery site. The Demo does not work. Get error:

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; WOW64; Trident/4.0; GTB7.4; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; .NET4.0C; .NET4.0E; .NET CLR 1.1.4322; MS-RTC LM 8) Timestamp: Mon, 20 Aug 2012 19:19:09 UTC

Message: Expected 'catch' Line: 7 Char: 25 Code: 0 URI: http://api.jquery.com/deferred.done/

Change History (5)

comment:1 Changed 7 years ago by dmethvin

Cc: jaubourg added

Whoa, that one doesn't make much sense to me. @jaubourg do you know what is going on? The error is showing this line:

<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="http://api.jquery.com/wp-includes/wlwmanifest.xml" />

comment:2 Changed 7 years ago by jaubourg

That's because IE8 is showing the wrong "deferred.done" file:

<!DOCTYPE html><html><head>
  <script src="http://code.jquery.com/jquery-latest.js"></script>
<style>html,body{border:0; margin:0; padding:0;}</style></head><body>   <button>Go</button>
 <p>Ready...</p><script>window.onload = (function(){
try{
// 3 functions to call when the Deferred object is resolvedfunction fn1() {
  $("p").append(" 1 ");}function fn2() {  $("p").append(" 2 ");}
function fn3(n) {  $("p").append(n + " 3 " + n);}// create a deferred object
var dfd = $.Deferred();// add handlers to be called when dfd is resolveddfd
// .done() can take any number of functions or arrays of functions
.done( [fn1, fn2], fn3, [fn2, fn1] )// we can chain done methods, too
.done(function(n) {  $("p").append(n + " we're done.");});
// resolve the Deferred object when the button is clicked
$("button").bind("click", function() {  dfd.resolve("and");});
}catch(e){}});</script>
</body></html>

Line 7, Character 25, is the end of a try which is there but the catch clause is added at the end of the script:

http://i49.tinypic.com/53tdog.png

Honestly dunno what's going on here but it looks like automated code wrapping gone wrong: notice how fn1 just disapeared in the process.

Here if the original code for comparison:

// 3 functions to call when the Deferred object is resolved
function fn1() {
  $("p").append(" 1 ");
}
function fn2() {
  $("p").append(" 2 ");
}
function fn3(n) {
  $("p").append(n + " 3 " + n);
}

// create a deferred object
var dfd = $.Deferred();

// add handlers to be called when dfd is resolved
dfd
// .done() can take any number of functions or arrays of functions
.done( [fn1, fn2], fn3, [fn2, fn1] )
// we can chain done methods, too
.done(function(n) {
  $("p").append(n + " we're done.");
});

// resolve the Deferred object when the button is clicked
$("button").bind("click", function() {
  dfd.resolve("and");
});

Who can fix this one? As in, who has access? Addy?

comment:3 Changed 7 years ago by mikesherov

Shouldn't we be filing this on the api.jquery.com github tracker?

comment:4 Changed 7 years ago by mikesherov

Resolution: invalid
Status: newclosed

Thanks for reporting this issue! It's been ported to here: https://github.com/jquery/api.jquery.com/issues/63 I'm only closing it as "invalid", as we have no other resolution currently to indicate it was ported.

https://github.com/jquery/api.jquery.com/issues/63

comment:5 Changed 7 years ago by anonymous

This is fixed now. I changed the double-slash comments in the demo code to slash-star comments.

Note: See TracTickets for help on using tickets.