iFrame src something other than javascript:false but same effect

Posted by macca1 on Stack Overflow See other posts from Stack Overflow or by macca1
Published on 2010-03-23T21:09:24Z Indexed on 2010/03/23 21:13 UTC
Read the original article Hit count: 334

Filed under:
|
|

Is there any other way to write javascript:false that is more pleasant?

I'm building a print functionality for an intranet app (for IE6) and I make the printed page using an iframe:

$('body').append('<iframe id="printIFrame" src="javascript:false"></iframe>');
$("#printIFrame").attr('style','position:absolute;left:-500px;top:-500px;');

Without having javascript:false in the src, I'll get the "This page contains both secure and nonsecure items" popup when I create it. However the downside of this is that "javascript:false" gets printed as the title on the bottom left of each page (instead of about:blank or something more useful).

Is there some kind of javascript technique that I can write javascript:false but in cleaner terms? I tried something like this

var PrintOut = false;
$('body').append('<iframe id="printIFrame" src="PrintOut"></iframe>');

But I couldn't get that working. Any other ideas?

© Stack Overflow or respective owner

Related posts about ie6

Related posts about iframe