开发者

jquery html() problems in CHROME

开发者 https://www.devze.com 2023-03-18 18:23 出处:网络
I have an Iframe inside my HTML. From that Iframe I\'m accesing to the parent window to retrieve the HTML code of a DIV with an ID=result

I have an Iframe inside my HTML. From that Iframe I'm accesing to the parent window to retrieve the HTML code of a DIV with an ID=result

Everythin开发者_开发技巧g works in FF3, FF5 and IE8, but not in Chrome 12. Code in Iframe is:

message = $(document, parent.window.document).contents().find('#resultsubmit').html();

However, if I remove html() method Chrome yes is returning a valid object (html object)

But as soon as I add html() to read de html inside an error happens.

Any clue about that?


use this:

var message = $(parent.window.document).contents().find('#message').html();
$('#target').html(message);
0

精彩评论

暂无评论...
验证码 换一张
取 消