admin管理员组文章数量:1429844
In Safari my Sign Up form JavaScript code works fine, but in UIWebView and in WKWebView that form isn't loading.
Here is my Code to review.
import UIKit
import WebKit
class ViewController: UIViewController, WKNavigationDelegate {
@IBOutlet weak var Webview: UIWebView!
var webView: WKWebView!
var websites = ["lampepany", "lampepany"]
override func loadView() {
webView = WKWebView()
webView.navigationDelegate = self
view = webView
}
override func viewDidLoad() {
super.viewDidLoad()
let url = URL(string: "https://" + websites[0])!
webView.load(URLRequest(url: url) as URLRequest)
webView.allowsBackForwardNavigationGestures = true
}
Main page opens correctly and then Menu -> Apply, on this screen Apply here form doesn't display.
Here are both screenshots attached. Safari and WKWebView.
Any help regarding this that my WKWebView start behaving like Safari and open each and everything correctly as Safari browser does.
When I put my website link here in this WKWebView browser then its working.
so why not in my code. I used the same code in my app but in vein.
Thank you in Advance!
In Safari my Sign Up form JavaScript code works fine, but in UIWebView and in WKWebView that form isn't loading.
Here is my Code to review.
import UIKit
import WebKit
class ViewController: UIViewController, WKNavigationDelegate {
@IBOutlet weak var Webview: UIWebView!
var webView: WKWebView!
var websites = ["lampepany.", "lampepany."]
override func loadView() {
webView = WKWebView()
webView.navigationDelegate = self
view = webView
}
override func viewDidLoad() {
super.viewDidLoad()
let url = URL(string: "https://" + websites[0])!
webView.load(URLRequest(url: url) as URLRequest)
webView.allowsBackForwardNavigationGestures = true
}
Main page opens correctly and then Menu -> Apply, on this screen Apply here form doesn't display.
Here are both screenshots attached. Safari and WKWebView.
Any help regarding this that my WKWebView start behaving like Safari and open each and everything correctly as Safari browser does.
When I put my website link here in this WKWebView browser then its working. https://github./mbarnig/WKWebView
so why not in my code. I used the same code in my app but in vein.
Thank you in Advance!
Share Improve this question edited Jun 8, 2017 at 20:43 Arsal asked Jun 8, 2017 at 20:31 ArsalArsal 3982 gold badges8 silver badges23 bronze badges1 Answer
Reset to default 6 +50Your web page Signup form (iframe) has SSL issue.
In iOS, If you are loading an http url, then you have to add App Transport Security Settings
in your info.plist
file.
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
I found the issue in the following way.
- Enable Safari Developer mode Safari-> Preference -> Advanced -> Show Developer option on Menu.
- Run your app on simulator and Open Safari browser on your Mac.
- Go to Developer menu -> Simulator -> Select your site url.
- You will get the console log of your web page.
Please see your web page console log below.
Error : Failed to load resource: An SSL error has occurred and a secure connection to https://www.lampeplacementservices./LampeOptin/LampeOptinReferralForm.html
本文标签: IOS WKWebView and UIWebView isn39t loading JavaScript Sign Up form while Safari doesStack Overflow
版权声明:本文标题:IOS WKWebView and UIWebView isn't loading JavaScript Sign Up form while Safari does - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745531156a2662066.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论