生成apk后,如何点击一个事件,跳转到另外一个网页

生成apk后,如何点击一个事件,跳转到另外一个网页。我是用的是cocos2d-js

可以直接在需要获取点击事件那边加如下代码:
if( ‘touches’ in cc.sys.capabilities ) {
cc.eventManager.addListener({
event: cc.EventListener.TOUCH_ONE_BY_ONE,
onTouchBegan: this.onTouchBegan,
onTouchMoved: this.onTouchMoved,
onTouchEnded: this.onTouchEnded,
onTouchCancelled: this.onTouchCancelled
}, this);
}
添加单点触摸事件,最后的this为触发事件的对象

重点是跳到一个网页

这样在触摸时间中可以用js自带的打开窗口的方法:
window.open (‘dollare.html’, ‘newwindow’, ‘height=100, width=400, top=0,left=0, toolbar=no,
menubar=no, scrollbars=no, resizable=no,location=no, status=no’)
第一个参数就是需要跳转的页面的url,后面的参数可以省略

window.open 在微信浏览器中是无法跳转网页的 需要使用window.location