Free Web Hosting Provider - Web Hosting - E-commerce - High Speed Internet - Free Web Page
Search the Web


Both broswers?

Some tips to make the JavaScript code common across both IE & Netscape

  • For all FORM elements, make sure that same identifier is used as both the id and name of the element. Otherwise, make sure that u're using the name property of the element in all ur JavaScript code. FYI, u can totally skip id property but still, IE can recognise the FORM elements with name alone.
  • Don't use WITH tag in JavaScript code. Instead, try qualifying FORM elements in the standard way, like, document.formname.elementname.property/function.
  • For all HTML elements, make sure that u're referring to their names in case sensitive manner, in the whole JavaScript code.
  • To make any Textbox/Textarea as readonly, try diverting the focus to some other FORM element.
  • Don't use OnUnload event.
  • Don't submit the form from any function. After all ur housekeeping works in the OnClick function, simply return from the function with true or false as return value.
  • Don't use the functions innerText and innerHTML, which r only supported by IE5.
  • Move all buttons into a HTML TABLE and try to align them using standard tags of TR and TD tags. Avoid using blank spaces for aligning the buttons on screen, which may give different appearance at different resolutions of the screen, different browsers and different sizes of the view font selected in the browser.
  • Don't use the "disabled" property of any HTML element.
  • Try to avoid the use of "Style:width=xxx height=xxx" construct for any HTML tag, though it's not mandatory.