Safari opens pages but web view is not - ios

I am using UIWebView to load a page, the page to load is made with ajax asynchronous, I don't know why, my UIWebView is not able to load the page, but Safari is able to load the same.
Any help related to the same is appreciated!!
Thanks

Related

display url in WKWebView when partially loaded

I have recently started working with WKWebViews. When loading a url the WKWebView appears to wait for all javascript to complete before it shows any of the page. Is there a way to allow the WKWebView to load content progressively like it does in a UIWebView. Thanks

UIwebview initially loaded zoomly?

Hi i am new to iOS development. I have uiwebview for load a website. What is my problem is when the website load 1st time in the uiwebview the page show zoomly. Then when click other page inside or refresh the same page its comes under normal responsive page. I want initially the page should be normal or responsive page.. Can any one help me. Thanks in advance

how to open external link from webview in popup window ios

I have embedded a webview in the view that loads a website. Now, I need to open external links inside webview in popup window.
Can anybody help me.
Thank you.
If you want to open popup's inside the UIWebview html rewriting is the best option.. write your html code in a file and load it in the webview
refer to the question for details..
Opening popup links in UIWebView, possible?

How to avoid a blink when UIWebView loads HTML

I have a native iOS app that contains a tab bar. The view controller for each tab contains a UIWebView. When the user switches between tabs, I load the HTML in the corresponding web view. The HTML is fully cached on a device. Here is how I feed the HTML to UIWebView:
[self.webView loadHTMLString:htmlString baseURL:baseUrl];
baseUrl is a file URL pointing to a directory where all assets are located.
This works great in online and offline modes, however it takes time for the UIWebView to parse and render the HTML. As a result, the user sees a brief blink of a white background when switching between tabs. I'd like to remove it, because the user is able to tell that the UI is not native (native UI renders instantly).
I was thinking about taking a screenshot of the UIWebView once it's done rendering the HTML and caching it in memory. The next time the user navigates to that web view, the app displays the screenshot while the UIWebView is rendering the HTML in the background. Finally, the app swaps the screen shot with the actual UIWebView and takes a new screenshot. This is similar to how Google Chrome app works.
Does anyone know a better solution to this problem?
Depends on how you present that web view. I'm not really sure from your description how you do it, but since you're talking about a blink of white background, I'm going to assume there is a situation where you have a web view with a loaded html and then you switch it to another html. The solution for that case would be:
create a second web view,
load the new html to this new web view,
when that web view finishes loading html (you can find out if you use UIWebViewDelegate) you can then quickly switch it with your old web view (meaning you finally add the new web view to the view hierarchy at THIS point, not when you created it).
This way you'll have an instant switch between old and new html, however user will be left waiting and it is your decision what to do with it. You could use UIActivityIndicatorView for example.
When webViewDidFinishLoad: gets called you can do any number of things, make the webview visible, remove something that you had on top of the webview etc...

FaceBook JavaScript API in native app UIWebview

I am creating an app which is reusing some of the HTML pages from my site. In one of the pages, there is a share event in facebook functionality. This is not working in UIWebview as there is no concept of "pop ups" in uiwebview. FB.Login() opens a new tab in an actual browser, but in UIWebview, it loads on top of the existing page.Hence after login, while the actual browser tab closes itself and transfers the control to the callback function in the original tab, UIWebview page just turns blank as it probably cannot find the original call back function anymore. Any solutions?

Resources