1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/2002/REC-xhtml1-20020801/DTD/xhtml1-transitional.dtd"> |
---|
2 | <html lang="fr"> |
---|
3 | <head> |
---|
4 | |
---|
5 | <title>.html() .evalScripts()</title> |
---|
6 | |
---|
7 | <script src="http://jqueryjs.googlecode.com/files/jquery-1.2.js" type="text/javascript"></script> |
---|
8 | |
---|
9 | <script type='text/javascript'><!-- |
---|
10 | $(function(){ |
---|
11 | |
---|
12 | $('<div><\/div>').appendTo('body') |
---|
13 | .html('A <scr'+"ipt>alert('A');<\/scr"+'ipt>'); |
---|
14 | |
---|
15 | $('<div><\/div>').appendTo('body') |
---|
16 | .html('B<form> <scr'+"ipt>alert('B');<\/scr"+'ipt><\/form>'); |
---|
17 | }); |
---|
18 | // --></script> |
---|
19 | |
---|
20 | |
---|
21 | </head> |
---|
22 | |
---|
23 | <body> |
---|
24 | |
---|
25 | FF inserts both A and B.<br /> |
---|
26 | MSIE and Safari insert A, not B |
---|
27 | |
---|
28 | </body> |
---|
29 | |
---|
30 | </html> |
---|