Search and FInd a word/Letter in a WebView - iphone

I have a Webview in which i display the html pages,there i have placed a search bar, Now I have to find a letter or a particular word that i type in the search bar, those letters or word should be highlighted with different color in the present html page.
Help me out
Thanks in Advance

you can search for those keyword inside your html document that you are showing on the webview .Now you can reload the webview with new html formed by replacing keyword string with <>keyword<> string .

Related

twitter boostrap collapsible divs search

I've the same as this http://www.w3resource.com/twitter-bootstrap/collapse.php and I need to create a search functionality, in order to find the searched word inside each accordion-group: inside the heading and inside the body, and highlight the matched words.
Is there a way to do it? Any idea?
Thanks

How to search text in UIWebView Consists of number of pages and the text should be highlighted in iPhone?

I parsed epub file into UIWebView.I tried to add UISearchBar for to find text and to be highlighted. For this i added UIWebViewSearch.js file. In my UIWebView i have so many pages. If click on next the next page is displayed or click on previous page previous page ids displayed. For this how to search the text in UIWebView ,How the text will be selected?
If anyone knows please help me.
Thanks in advance...........
There are plenty of examples on the web of JavaScript search and highlight functionalities.
Here is an example.
Once you have working JavaScript to search for terms and highlight them in the web page, you will need to call your JS and pass it the text that was entered in the UISearchBar.
This can be achieved by using:
NSString *jsCall = [NSString stringWithFormat:#"searchAndHighlight('%#');", yourSearchText];
[webView stringByEvaluatingJavaScriptFromString:jsCall];
UIWebView Class Reference

How to erase the searchform, on the search results page, of indexed_search?

I tried to just erase the html markup from the indexed_search template file, this does work fine, until I found out that this causes a Javascript error where I can not use the numeric navigation. (Page 1 Page 2 Page 3 Next >).
So is there a typoscript command, or a other way, to erase the search form which is on the results page?
Unfortunately when you empty the search form you won't be able to use the page browser at all.
It is using the value from the search form and an offset (basically does a new search with your parameter)
Idea for a workaround: How about hiding the standard search form (that contains the search term) with display:none; and adding a second, empty search form to the template?

Problem in rendering Hebrew text in UIWebview

I have some hebrew text stored in database. When I fetch & render it in UIWebview after applying some css (setting the background color and margin for the page) the text comes up fine but the problem is that If I right align the content in webview then the Hebrew content gets right aligned but actually it is not the way it is supposed to be. I mean the way RTL text should have shown. The Full stop appears on the right hand side of the text as shown in image below. I know that right aligning the text will not show it the way RTL text should be
Its not a duplicate and I have gone through the steps mentioned there but still no go.
I hope if someone can help me to shown the text in correct way . I can add the CSS snippet if required. Please comment if any supporting code or image is required
You should either set direction: rtl in the CSS or add a dir="rtl" attribute in the HTML.
You may also need to fiddle with the unicode-bidi CSS attribute as well if you're embedding this text into a mixed-language paragraph.
u need to specify dir="rtl" in html then you will get the data from right to left
Example:
NSString *htmlStringwithFont = [NSString stringWithFormat:#"<span style=\"font-family: %#; color:#343434;font-size: %i\" **dir=\"rtl\"**>%#</span>",
font.fontName,
(int) font.pointSize,
content];
webView.opaque=NO;
[webView loadHTMLString:htmlStringwithFont baseURL:nil];

Annotating text in UIWebView

I am writing a app that has a UIWebView that displays a HTML5 page. I want to annotate some text on the web page and save it in SQLite database. The annotated text must be changed to a specific color as a visual effect.
Any suggestions that how can I select and get the text back in Objective-C?
You have two choices:
Parse the HTML5 document by hand
Inject Javascript into the page and walk the document. See Search and highlight text in UIWebView