As bruce said,<head> contents has no printable content, can you show me your html page?
zhyanadil.it@gmail.com
var sWinHTML = $("#div_content_print iframe").contents().find('body')[1];
var sWinHTML2 = $("#div_content_print iframe").contents().find('head')[1];
Under normal circumstances, the content of the frame should be the following code:
var sWinHTML = $("#div_content_print iframe").contents().find('body')[0];
var sWinHTML2 = $("#div_content_print iframe").contents().find('head')[0];
Best regards,
Sam
.NET forums are moving to a new home on Microsoft Q&A, we encourage you to go to Microsoft Q&A for .NET for posting new questions and get involved today.
Member
75 Points
513 Posts
how to add section head iframe into window print
Jan 17, 2020 06:32 PM|zhyanadil.it@gmail.com|LINK
i wrote this code but i get blank white page print
All-Star
58254 Points
15675 Posts
Re: how to add section head iframe into window print
Jan 17, 2020 08:58 PM|bruce (sqlwork.com)|LINK
in general the <head> contents has no printable content.
also generally there is only one head and one body in a document so body[1] & head[1] are undefined
note: one check with the debugger would tell you this. Have you not learned about debuggers yet?
All-Star
53101 Points
23659 Posts
Re: how to add section head iframe into window print
Jan 17, 2020 10:53 PM|mgebhard|LINK
This is a duplicate post. Is there any reason why you did not use the code in the working example? Why are you breaking the code?
https://forums.asp.net/t/2163280.aspx?how+to+set+div+content+into+another+div
Contributor
3370 Points
1409 Posts
Re: how to add section head iframe into window print
Jan 18, 2020 03:31 AM|samwu|LINK
Hi zhyanadil,
As bruce said,<head> contents has no printable content, can you show me your html page?
Under normal circumstances, the content of the frame should be the following code:
Best regards,
Sam