Retrieving Multiple Anchor Tags.
Retrieving Multiple Anchor Tags.
- Subject: Retrieving Multiple Anchor Tags.
- From: Philip Juel Borges <email@hidden>
- Date: Thu, 14 May 2009 16:50:22 +0200
Hi,
The code below retrieves an anchor tag name '25' from the '1.html'
document when I type '25' in my NSTextField, and loads it in WebView.
But the '1.html' document contains many numerical anchor tags. Does
anybody know how I can retrieve any anchor tag I type in NSTextField
and load it in WebView?
- (void)gotoAnchor:(NSString *)name {
NSString *path = [[NSBundle mainBundle] pathForResource:@"1"
ofType:@"html"];
NSURL *baseURL = [NSURL fileURLWithPath:path];
NSURL *url = [NSURL URLWithString:[NSString
stringWithFormat:@"%@#%@",[baseURL absoluteString], name]];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[[webView mainFrame] loadRequest:req];
}
- (IBAction)gotoAnchorTag25:(id)sender
{
[self gotoAnchor:@"25"];
}
/Philip
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden