I was just practicing javascript when I encountered this code. First I will type the code and then will tell you about the problem. starting right from the main code and eliminating all the necessary tags. function GetVersion() { var place=0 place=navigator.appVersion.indexOf(" ") return (navigator.appVersion.substring(0,place)) } document.write ("<h2>you are running navigator") document.write (" version " + GetVersion() + "</h2>") Of course this code will display the navigator version I am using. In my case it's navigator version 5.0. My question is that how the indexOf(" ") method is returning the navigator version? because the purpose of indexOf() method is just to return the position of string. Or in simple words please explain the purpose of the code in the next two lines right after var place=0. Now coming to CSS styling. I created a simple blog template. When I tried to type in the characters, the extra characters won't shift to the new line unless I use the <p></p> tags. I think it has something to do with the overflow property. However tell me the way in which I can set my blog so that it starts accomodating extra characters to the new line automatically without even using <p></p> tags. Just like in any wordpress or blogger blog. I hope you understand.
Navigator App version will be usually e: 4.75 [en] (Win98; U)] The javascript function find out the occurence of first space ie index of first space ...since space is the separator in the string "e: 4.75 [en] (Win98; U)]" with space as separator...and then reurns the substring starting from zeroth index to index of first space index Thus returns the appvesion number Hope this helps