[]AS中使用__JS__调用html文件中的函数
您好,请教下,var timestamp:Number = __JS__("getLastModified()");
原来AS项目中,getLastModified()是写在index.html里面的,用于获取index.html的最后修改时间,现在laya应该写在哪个文件呢?
写在index.html调不到。
报错如下:
Uncaught ReferenceError: getLastModified is not defined
at new MhsgStarter (MhsgStarter.max.js:1572)
at MhsgStarter.max.js:28127
at MhsgStarter.max.js:28129
原来AS项目中,getLastModified()是写在index.html里面的,用于获取index.html的最后修改时间,现在laya应该写在哪个文件呢?
写在index.html调不到。
报错如下:
Uncaught ReferenceError: getLastModified is not defined
at new MhsgStarter (MhsgStarter.max.js:1572)
at MhsgStarter.max.js:28127
at MhsgStarter.max.js:28129
要回复问题请先登录
1 个回复
cuixueying
赞同来自:
2、如果你想用__JS__(),这个是调用js原生方法的,你可以把你的代码段封装到一个单独的js文件下,然后通过script src的方式引入(自定义标签需放到主js标签之上,保证该js已经加载完成),然后通过__JS__()的方式去掉该js下的方法!