getting value from JSON in iPhone through JAVASCRIPT
I am building an application to fin开发者_如何学Cd the route between two places.Also, i have to give the details of checkpoint between the route.In this case, I'm struggling. Through JSON i got the different checkpoint like this
"<b>NH 75</b>\U3092\U9032\U3080<div class=\"google_note\">\n<b landmarkid=\"0x39847e91e9351f85:0x9e82c70b4b91c047\" class=\"dir-landmark\">\U30da\U30c8\U30ed\U30fc\U30eb\U30fb\U30d1\U30f3\U30d7</b>\U3092\U901a\U904e\U3059\U308b<div class=\"dirseg-sub\">\Uff0831.0 km \U5148\U3001\U5de6\U624b\Uff09</div>\n</div>"
"\U5de6\U6298\U3057\U3066<b>SH 11</b>\U306b\U5165\U308b"
"1 \U3064\U76ee\U306e\U89d2\U3092\U53f3\U306b\U66f2\U304c\U3063\U3066\U3001\U305d\U306e\U307e\U307e<b>SH 11</b>\U3092\U9032\U3080<div class=\"google_note\">\n<b landmarkid=\"0x39847f74faa9a325:0xd74f16593a886b60\" class=\"dir-landmark\">Prem Nursing Home</b><div class=\"dirseg-sub\">\Uff08\U53f3\U5074\Uff09</div>\U3092\U901a\U904e\U3059\U308b</div>"
for this, i have to print value like this....
1. Continue onto NH 75
Pass by Petrol Pump (on the left in 31.0 km)
2. Turn left onto SH 11
3. Take the 1st right
to stay on SH 11
Pass by Prem Nursing Home (on the right)
I'm getting place name.But, in fetching details m struggling. How can it be done. Any help would be appreciated. Thanx in advance.
A UIWebView has the method - stringByEvaluatingJavaScriptFromString: - this should help with your issue.
Example:
NSString *result = [myWebView stringByEvaluatingJavaScriptFromString:@"someJavascriptFunction(42);"];
精彩评论