开发者

Clone problem in IE7. Please note I can't change the HTML

I need to clone a button in a frame(AssessmentsIFrame) whose id is “wpv_1266351” to a td and I need to clone a div in a frame(AssessmentsIFrame) whose name is “titlediv_1266230” to a second td in a table. I am using the following statements to achieve it but it is开发者_开发知识库 not working in IE7.(It is working in Firefox)

$('#AssessmentsIFrame').contents().find('#wpv_1266351').clone().appendTo('#AssessmentRequestFormButton');

$('#AssessmentsIFrame').contents().find('#titlediv_1266230').clone().appendTo('#MedicalBriefButtons');

Can someone please help me with this? It should work in Firefox and IE. Please note I can't change the HTML.

<div id="button-cus"><input type="button" onclick="_openpageview(1266351,'bGZLNEFJBxs9RFYgPUNMJQIGEhAyUgowH2JdVERBZF4~',1)" value="Open" id="wpv_1266351" name="wpv_1266351" class="Button"></div>

Thanks.


oFrame = $('#AssessmentsIFrame')[0];
$('#wpv_1266351', oFrame.contentDocument).clone().appendTo('#AssessmentRequestFormButton');
$('#titlediv_1266230', oFrame.contentDocument).clone().appendTo('#MedicalBriefButtons');

Why are you making it so hard for yourself? I suppose you use your id's unique, so why checking for another id's content instead of just selecting the ID you want? Make sure you change your clone's id after creating it, so your ids stay unique. Good luck!

-edit-

over-read the fact that you used an iFrame.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜