UIWebVIew Javascript 文档.location
我无法让我的 UIWebView 基于 javascript 更改位置。虽然这看起来有点多余,但这是必要的,因为当 document.location 已知时,客户的网站会存储 cookie。但是,当我尝试访问他网站的下一部分时,它不会打开。
这是代码
[self.webView stringByEvaluatingJavaScriptFromString:@"document.location = 'http://www.nextLink.com'"];
但是,这似乎没有做任何事情。 document.write 方法也有效!
谢谢!
I have been unable to get my UIWebView to change location based in javascript. While this may seem a bit redundant, it is necessary because the client's website stores a cookie when document.location is known. However, when I try accessing the next part of his site, it will not open.
Here is the code
[self.webView stringByEvaluatingJavaScriptFromString:@"document.location = 'http://www.nextLink.com'"];
However, this doesn't seem to have done anything. Also the document.write method works!
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过使用
window.location
来代替?Have you tried with
window.location
instead?