JavaScript : code those compatibile for all the browsers (IE/FF/NetScape/Opera/Google Crome)
Hello friends,
I would like to write javascript code those compatibile for all the browsers
and the code for...
1) web site validation
2) Trim (left, right, in between)
3) windom.open
4) CSS
etc
please frds help me ASAP
1 Answer
Know the answer? Post it. Somebody with the same question will find it here.

Kirtan PatelRank #292 · 8.6K reputationPosted Dec 14, 2009, 10:10 PM EST
below are trim() function built using RegEx that will work in any modern browsers java script 1.2 or 3.0 :) if my answer helps you then check do you like this answer" check box :) please :) Cross-Browser Trim() -------------------------- function trim(stringToTrim) { return stringToTrim.replace(/^\s+|\s+$/g,""); } function ltrim(stringToTrim) { return stringToTrim.replace(/^\s+/,""); } function rtrim(stringToTrim) { return stringToTrim.replace(/\s+$/,""); } Cross Browser -Window.Open() ------------------------------ var WindowObjectReference; // global variable function openRequestedPopup() { WindowObjectReference = window.open("http://www.domainname.ext/path/ImageFilename.png", "DescriptiveWindowName", "resizable=yes,scrollbars=yes,status=yes"); }