New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android中的webview 加载seajs时 document.URL取到了js路径 导致113行dirname方法中的path为null #1225
Comments
这个在ie本地下也会有错,曾经是location,后来改URL是为了更短,再后来又改回来了,但还没发布。你可以自己先改回来。 |
是把var cwd = dirname(doc.URL) 改为var cwd = dirname(doc.location.href);? |
看来空白页,新标签页之类的这个正则会出错,目前只有webview这样的容器会有了? |
目前我只在 android 的webview上发现这个问题了 而且偶尔会正常运行。 机型是 红米 |
这样改不生效,doc.URI为'about:blank'还是会报错。 var cwd = (!location.href || location.href.indexOf('about:') === 0) ? '' : dirname(location.href) |
嗯 不好意思哈 刚才出去了一趟 没及时看到 |
可以解决了 |
。。。。。 |
cwd在解析相对域名(./和/)以及seajs.use时使用,use可以忽略,在当前页面上解析相对域名,页面肯定有url。 哇哈哈哈哈,我是玉伯的小号~~~ |
玉伯的马甲?? |
DOM Exception 18 |
嗯 好的 非常感谢 。我自己再研究一下。。。 |
set cwd to an empty string if locatoin.href is unusual seajs#1225
问题已修复了。 跨域问题似乎是由于我在添加js前有一个不同域的跳转。 |
跳转不驻留的 |
确实应该不驻留 |
异常信息:Cannot read property '0' of null 对应的代码在 113行
return path.match(DIRNAME_RE)[0];
然后导致 后面再调用seajs.config时 出现 object has no method 'config'
因为是在手机端使用的 所以 问题可能无法重现。 之后我用日志跟踪调试之后 发现出现该问题时 document.URL(在113行 输出了 doc.URL) 输出的是异步加载进去的seajs.js的路径 而在正常运行时 输出的是 当前网页的路径 。
另外没太看懂 为何在254行 要用
var doc = document
var cwd = dirname(doc.URL)
这个方式获取路径,而不用window.location.href?
现在不确定是否是由于webview加载顺序的问题 还是什么原因?
有人遇到过么?
The text was updated successfully, but these errors were encountered: