在新网页中显示一个字符串 [英] show an string in new web page
本文介绍了在新网页中显示一个字符串的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
嗨
我用流阅读器读取html文件并保存在字符串变量中
如何在新网页中显示该变量
i测试它,但不能正常工作...
Response.Write( <脚本> 中跨度>);
Response.Write( window.open(' + StrContent.ToString()+ ','_ blank'));
Response.Write( < / script>);
解决方案
使用此:
var w = window .open(' ',' ',' width = 400,height = 400,resizeable,scrollbars');
w。 document .write(' Content去这里');
w。 document .close(); chrome和safari需要 //
而不是:
window .open(' 内容');
更新:
将您的代码更改为:
Response.Write( < script>);
Response.Write( var w = window.open('','','width = 400 ,高度= 400,调整大小,滚动条);跨度>);
Response.Write( w.document.write('Content goes here'););
Response.Write( w.document.close(););
Response.Write( < / script>);
Hi
I read the html file with stream reader and save in string variable
how i can show that variable in new web page
i test it , but not work ...
Response.Write("<script>");
Response.Write("window.open('"+StrContent.ToString()+"','_blank')");
Response.Write("</script>");
解决方案
Use this:
var w = window.open('', '', 'width=400,height=400,resizeable,scrollbars'); w.document.write('Content goes here'); w.document.close(); // needed for chrome and safari
Instead of:
window.open('Content');
Updated:
Change your code to:
Response.Write("<script>"); Response.Write("var w = window.open('', '', 'width=400,height=400,resizeable,scrollbars');"); Response.Write("w.document.write('Content goes here');"); Response.Write("w.document.close();"); Response.Write("</script>");
这篇关于在新网页中显示一个字符串的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文