Bug Tracker

Opened 14 years ago

Closed 12 years ago

#3703 closed bug (worksforme)

IMG tag creation/append is not working in Opera 9.52

Reported by: delf Owned by:
Priority: minor Milestone: 1.3
Component: core Version: 1.2.6
Keywords: jsonp, opera Cc:
Blocked by: Blocking:

Description (last modified by davidserduke)

this example from page http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback

          $.each(data.items, function(i,item){
            $("<img/>").attr("src", item.media.m).appendTo("#images");
            if ( i == 4 ) return false;

is not working in Opera 9.5

Attachments (2)

jquery_test.html (415 bytes) - added by davidserduke 14 years ago.
jquery_test.2.html (662 bytes) - added by aaron.gundel 14 years ago.
slightly modified replication

Download all attachments as: .zip

Change History (8)

comment:1 Changed 14 years ago by aaron.gundel

Appears to be relevant in 9.63 also. Does not appear to be related to JSONP though: I tried replicating and found that the JSONP executes properly and returns links to the photos as expected; but the manipulation code appears to be failing.

comment:2 Changed 14 years ago by davidserduke

Component: ajaxcore
Summary: getJSON JSONP is not working in Opera 9.52IMG tag creation/append is not working in Opera 9.52

Aaron appears to be correct and this has nothing to do with JSONP. The URLs seem to be coming back fine and it is the creation of the IMG tags and appending them to the DIV that seems to have the problem.

That being the case I'm going to change the summary to reflect the issue.

Changed 14 years ago by davidserduke

Attachment: jquery_test.html added

comment:3 Changed 14 years ago by davidserduke

Description: modified (diff)
Priority: majorminor

Attached a simplified test case. To my eye this appears to be a browser bug. The test case works in FF2 and IE7, but not Opera 9.52. Also works in Opera 9.26 so hopefully they will fix it. I'm not sure how jQuery could provide a fix so we might have to close this ticket regardless.

Changed 14 years ago by aaron.gundel

Attachment: jquery_test.2.html added

slightly modified replication

comment:4 Changed 14 years ago by aaron.gundel

This is an interesting issue. Appears to be happening because of the use of the $("<img/>") call to create an element. The DOM is properly manipulated (you can see the img appear under the body), but the image doesn't load for some reason. Found that if you have a second call right after the appendChild call using an element made from document.createElement("img") this succeeds. This is indeed probably a browser bug. Will submit report on it and see if that goes anywhere...

comment:7 Changed 14 years ago by victor.lima

Work-around for this bug, tested to work on Opera 9.64

After you have appended to the element you have to do this: $(element).css("visibility", "visible");

That worked like a charm for us.

comment:8 Changed 12 years ago by addyosmani

Resolution: worksforme
Status: newclosed

The original example in the docs page is working fine on Opera 9.5 and latest on OSX using jQuery 1.4.3. I believe this issue should be fixed and working now.

Note: See TracTickets for help on using tickets.