...

View Full Version : Searching within code...



logicalt
12-04-2009, 02:57 AM
I'm looking to find a way to search through javascript in the current document and save certain lines into an array. If the code had been in a div, I could easily use something like document.getElementById("Something".value but in this case, the code is in the header and I'm not positive how to read the information.

Any suggestions would be a great help.

Philip M
12-04-2009, 08:05 AM
Could you please give a clearer explanation of what you are trying to achieve, and why you want to do this?

You can capture the entire HTML page source thus:-


<script type="text/javascript" >

window.onload=function(){
var str = document.getElementsByTagName('html')[0].innerHTML;
alert (str);
}

</script>

"Success is the ability to go from one failure to another with no loss of enthusiasm."
Sir Winston Churchill, British politician (1874 - 1965)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum