uiwebview

User interaction sometimes screws up jQuery ajax requests in UIWebView

馋奶兔 提交于 2020-02-02 02:16:25
问题 I'm building an iPhone app that displays a UIWebView pointing to a web application I've created. The web application makes frequent web service calls for data items which are used to animate controls on a canvas. The calls for data use jQuery ajax, passing parameters via JSON and receiving an XML response. I'm finding that while user interactions with the UIWebView are occurring, the javascript setTimeout method is blocked and doesn't seem to execute at all. Fair enough; there are ways around

iOS webview app crash when accessing iPhone photo library

我的梦境 提交于 2020-01-26 04:11:07
问题 iOS webview app crash when accessing iPhone photo library I was trying to upload photos using wordpress media library, after i click upload button, two options pop up from iphone: photo from iPhone photo library or from cloud. After clicking iphone photo library option, the app quits. Any idea is Appreciated 回答1: You need to add Photo library permission in your app open your info.plist file add bellow xml code <key>NSPhotoLibraryUsageDescription</key> <string>Allow to access photo library.<

How to display images in the uiwebview

大憨熊 提交于 2020-01-26 04:01:07
问题 I am implementing a UIWebView. In that I just need to display an iamges. But I am not able to do it. Please check out my code, and please let me know does I make any mistake. NSString *absStirng=[[[NSBundle mainBundle] resourceURL] absoluteString]; appendString =[appendString stringByAppendingString:@"<html>"]; appendString =[appendString stringByAppendingString:@"<body>"]; appendString =[appendString stringByAppendingString:@"<a href='/#/'><img src="]; appendString =[appendString

URL filtering for UIWebView on the iPhone

限于喜欢 提交于 2020-01-24 19:45:46
问题 Can someone please shed some light on how I would get this to work: http://www.icab.de/blog/2009/08/18/url-filtering-with-uiwebview-on-the-iphone/ I tried making the "FilteredWebCache.h" and "FilteredWebCache.m" files in my project, but it said that "FilterManager.h" did not exist. What am I meant to do with those files? This I put in viewDidLoad: NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); NSString *docDir = [paths objectAtIndex:0];

Objective C - UIWebview to load only a certain part of the webpage?

百般思念 提交于 2020-01-24 10:07:05
问题 I am working with a UIWebview, is there anyway I can just load just the body of a webpage instead of the entire webpage with my UIWebView (aka not load the header and footer)? This website is not mine. But looking at the HTML of this site, I only want to load to div id="mainContent" to /div Either by writing some objective c or javascript? Thanks! Alan 回答1: With Web-Kit you can parse the incoming HTML and do whatever you like to it (within, legal rights to the site you are reading) Once the

Export UIWebView Full Content to NSData? iPhone

蹲街弑〆低调 提交于 2020-01-24 09:34:25
问题 What I am trying to do is get the UIWebView s full content (Text, images, and CSS) in one litte package. I figured NSData would be the best way to do this. Or is there another more compressed version? 回答1: Probably late enough to respond to this, but I figured out you can get all the data from the request you made with NSCachedURLResponse as such: NSCachedURLResponse* response = [[NSURLCache sharedURLCache] cachedResponseForRequest:[webView request]]; NSData* data = [response data]; 来源: https

Limit UIWebView to specific URL (Swift)

淺唱寂寞╮ 提交于 2020-01-24 08:42:52
问题 I'm trying to develop an iOS app that features a UIWebView in Swift, however I need it to only work with one domain, and any external links clicked on in that UIWebView to be opened in Safari. (E.G. All links to http://example.com will open within the UIWebView, but a link to http://twitter.com would open in Safari). I have found a couple of solutions online but the only Swift version (found here: UIWebView open links in Safari) works to open every link in Safari, I just want external ones to

Swift UIWebView not loading http sites

女生的网名这么多〃 提交于 2020-01-24 05:25:08
问题 I created a web view controller and it loads https sites(ex: , ) but not http, non ssl secured sites(ex: http://bswd.us, http://www.barretthillins.com). When i do put a hhtp site in there, it does load but just a blank, white web view. How would i need to fix this? 回答1: This is due to the App Transport Security, a new protocol introduced by Apple at WWDC 2015. It doesn't allow any connections that are not HTTPS . You can disable it, however it's not recommended as it secures your app. To

Links in remote JQueryMobile sites in a PhoneGap app open safari

不打扰是莪最后的温柔 提交于 2020-01-24 05:12:08
问题 I'm having quite a peculiar problem with PhoneGap and JQuery Mobile, using the latest versions of both frameworks as of this writing. My phonegap app has some pages 'local' to the app, and other pages that are loaded directly from a remote site. Going between the local and remote pages is fine (there is no transition but that can't exactly be helped). However, once I'm on the remote pages, any link I click on the remote pages opens Safari with the page I requested. This is not desirable

Can I use username and password information from UITextFields to log onto a website in a UIWebView automatically?

喜你入骨 提交于 2020-01-23 23:46:06
问题 I am currently trying to find a solution to this task. Essentially I have an initial UIView that asks for the users username and password for a specific site, this information would then get past onto the next view which has a UIWebView inside. I would like to know if its possible to automatically fill in the username and password details on the site and send the user directly to their account page on the site. Thanks. 回答1: assuming your website has div tags you can inject using