Opened 12 years ago
Closed 12 years ago
#9291 closed bug (worksforme)
append node to body element
Reported by: | OlgaGr | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | manipulation | Version: | 1.6.1 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
I noticed a problem with appending elements to body node in IE9.
Example code:
<!DOCTYPE html> <html> <head> <title>Test</title> <script type="text/javascript" src="http://code.jquery.com/jquery-1.6.1.js"></script> </head> <body> <a href="http://codequest.eul">test</a> <script type="text/javascript"> jQuery(document).ready(function($){ $('a').click(function(){ $('body').append('<p>test</p>'); return false; }); }); </script> </body> </html>
IE9 don't prevent default event and redirect to the location which is in href attribute. I tried to replace the value of href attribute to "#". Then I get this error message in the browser console:
error in jquery-1.6.1.js, row 5569, character 5.
When I'm trying to append to another element, for example:
$('a').append('<p>test</p>');
it works fine. When I remove http adress from href attribute
Change History (2)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Component: | unfiled → manipulation |
---|---|
Priority: | undecided → low |
Resolution: | → worksforme |
Status: | new → closed |
I created a test case and everything seems to be working fine in all browsers: http://jsfiddle.net/timmywil/BGt8U/
If you can reproduce with a test case, we can revisit this ticket.
jsFiddle doesn't seem to work, so I put code inline.