Re: Using an anchor in NSURL file url

2016-01-22 Thread diederik
Would it be possible to parse the anchor out from the url and then once the page is completely loaded in the webview use javascript's window.location to jump to the anchor's location within the page. I know that can work for UIWebView, not 100% sure for WKWebView. > On Jan 21, 2016, at 7:17

Re: Using an anchor in NSURL file url

2016-01-22 Thread Jens Alfke
> On Jan 21, 2016, at 6:23 PM, Jeff Evans wrote: > > //The full url appears to have the anchor prepended, plus a couple of > dashes: > > #page3-- [pathtobook is here]/book/chapter1.html The .description property of a URL assembled with -relativeToURL is

Re: Using an anchor in NSURL file url

2016-01-21 Thread Jeff Evans
Thanks - Here's what I'm doing: Assume a directory called book and a file called chapter1, and an anchor called #page3 NSString *filePath = [[NSBundle mainBundle] pathForResource: chapter1 ofType: @"html" inDirectory: book]; //That file path gets converted to a

Re: Using an anchor in NSURL file url

2016-01-21 Thread Ken Thomases
On Jan 21, 2016, at 7:17 PM, Jeff Evans wrote: > > Colleagues, > > In OSX I'm using an NSURLRequest to load a file url in WKWebView. Works > fine unless I try to add an anchor to the path, for example, > > [path]/filename.html#anchorname The most correct way would

Using an anchor in NSURL file url

2016-01-21 Thread Jeff Evans
Colleagues, In OSX I'm using an NSURLRequest to load a file url in WKWebView. Works fine unless I try to add an anchor to the path, for example, [path]/filename.html#anchorname The problem appears to be that the # gets escaped to %23. I tried [NSURL URLWithString: anchorname

Re: Using an anchor in NSURL file url

2016-01-21 Thread Quincey Morris
On Jan 21, 2016, at 17:17 , Jeff Evans wrote: > > In OSX I'm using an NSURLRequest to load a file url in WKWebView. Works > fine unless I try to add an anchor to the path, for example, > > [path]/filename.html#anchorname > > The problem appears to be that the # gets