javascript - iphone uiwebview hyperlink -
i have display uiwebview content using javascript stringbyevaluatingstring.
in project hyperlink not working. how enable links in uiwebview?
anybody know please give piece of sample code or idea.
just sample try:
in uiviewcontroller "own" uiwebview named: "yourwebview"
// navigate new html file: [yourwebview stringbyevaluatingjavascriptfromstring:@"document.location='anewhtmlfile.html'"];  // show normal javascript alert window message: [yourwebview stringbyevaluatingjavascriptfromstring:@"alert('this alert message looks like.');"];  // ask html file own title: nsstring *apps = [yourwebview stringbyevaluatingjavascriptfromstring:@"document.title"]; nslogg(@"the title is: %@", apps);  // call personal js in html document: [yourwebview stringbyevaluatingjavascriptfromstring:@"callmyjsfunctiontoshowmyalert('hallo!');"]; // whit in html file:     <head> ...     <script>     function callmyjsfunctiontoshowmyalert(amsg) {         alert(amsg);     }     </script> ...     </head> if of these funcs don't works there may error somewhere when instantiate uiwebview loading html file. looking for?
Comments
Post a Comment