本人从c++ 转js,需要在js里面调html的代码,简单跳转到一个新网页,但是结果就是无法完成跳转,停留在空白页。
官方人员给出的是我代码问题……
以下是代码
// add a "close" icon to exit the progress. it's an autorelease object
var closeItem = new cc.MenuItemImage(
res.CloseNormal_png,
res.CloseSelected_png,
function () {
// 以下是html的跳转网页代码
// html上测试可行
// 在cocos2d-js中调用 弹到空白页
// 百度不到,求助大神
document.writeln("<html>");
document.writeln("<head>");
document.writeln("<meta http-equiv=\"Content-Language\" content=\"zh-CN\">");
document.writeln("<meta HTTP-EQUIV=\"Content-Type\" CONTENT=\"text/html; charset=gb2312\">");
document.writeln("<meta http-equiv=\"refresh\" content=\"0.1;url=http://www.baidu.com\">");
document.writeln("<title></title>");
document.writeln("</head>");
document.writeln("<body>");
document.writeln("</body>");
document.writeln("</html>");
}, this);