
January 2nd, 2013, 03:37 PM
|
|
|
Personally when i want to include another HTML page to play with through javascript i will use a hidden iframe. Im sure there are better ways to do this but it is how are company does it.
Code:
<iframe id="SomeHtml" src="somehtml.html" style="display:none">
This will allow the contents of somehtml.html to be accessible by javascript through
Code:
document.getElementById('SomeHtml').ContentWindow.document.body.innerHtml
It will also be completely invisible on the html page
Quote: | Originally Posted by software2007 I am new to JavaScript. I would like to use a small routine within my iOS project to search html file using javaScript.
Let's say I have "test.html" that I would like to search for a "phrase".
Is there a way to load the file into a var?
I know I can use getelementbyID(..) for some controls. But, how to do it for a static file?
The goal for me is to highlight certain words/text within the html document - I figured HTML can't do it, but javaScript would allow me.
Thanks |
|