I am trying to print
the html contents
to a new window
.
var w= window.open();
var htmlContent = $(printdiv).html(printcontent);
$(w.document.body).html(htmlContent);
$(w).location.reload();
$(w).focus();
$(w).print();
$(w).close();
I am a getting a blank window
with no html
contents instead?
Try setting new
window
name reference , removing$()
wrapper aroundw
at.focus()
,.print()
,.close()
asjQuery()
does not have method.print()
calling.print()
chained to$()
would returnTypeError: undefined is not a function
jsfiddle http://jsfiddle.net/14f5owux/