Jump to content

doctype prevents javascript from working


real_illusions

Recommended Posts

I have been given this website to sort out for SEO. Originally it had no doctype, so i added one in<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/loose.dtd">But this prevents some javascript from working with a menu, which uses it to create a drop down/disappeaing/appearing menu type thing..As this is a private project, i dont particularly wish to show the website.Any ideas on what can cause this and why it does it? Or do you need more info?

Link to comment
Share on other sites

Just tried it in Firebug.It has errors in firebug with the doctype in -document.all has no propertiestoggleBespokeFurniture()radiatorcabs.js (line 8)onclick(click clientX=0, clientY=0)bespokefurniture.... (line 1)[break on this error] if (document.all.bespoke_furniure_hidden.value=='hide') {Which doesn't mean much to me :)

Link to comment
Share on other sites

There is no all property of the document in XHTML. You have to use the document.getElementById() method instead. Try

document.getElementById('bespoke_furniure_hidden').value=='hide') {

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...