Networking | Hardware | Software | Multimedia | System | Unix&Linux | MBA

Home>>Hardware>>script does not work on Mozilla FIrefox when doctype is on the html code

script does not work on Mozilla FIrefox when doctype is on the html code

ron wolpa
02-04-2005, 04:12 AM
not quite sure if my post fits this forum but here it goes anway

the month script does not work on Mozilla Firefox 1 :

<!-- ----------------- -month script- --------------- -->

<script type="text/javascript">
//<![CDATA[
var n = new Date(), m = ['Janeiro', 'Fevereiro', 'Mar&ccedil;o', 'Abril', 'Maio', 'Junho', 'Julho', '
Agosto', 'Setembro', 'Outubro', 'Novembro', 'Dezembro'];
document.write(m[n.getMonth()] + ' ' + n.getFullYear());
//]]>
</script>

<!-- -------- month script ///////////// ----------- -->


It is just remove the doc type and month script will work normally;.
What´s wrong ?


.............................................employed doctype...............
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

hemebond
02-04-2005, 04:22 AM
XHTML does not support document.write(). Stick to HTML if you want to use this method or want to support Internet Explorer (which doesn't support XHTML).


 

TOP

For more info

setting a minimum size
Auto Preview of Image 
Refresh with a query s
JS Validation obsolete
Javascript Pop up func
Slide show transitions
I'm a newbie...please!
how to write coding in
Advanced Debug Info 
.js file doesn't work 

News Archive

Adding Graphic To Text
re-direct form after s
pop up window controls
Clock on homepage - He
passing a param from a
Password Procection wi
document.title in same
focus onload 
Counting Wrong from Ri
Help needed on how to 

Related stories:

window.open By Using onClick in <option> tag?
contentEditable in Gecko
Problems with insertbefore method
Combine Hightlight with Add and Delete Selected Row
Change background for different resoloutions?
Document.getElementById() has no properties
Add and delete rows dynamically to an HTML table .... ?
smart menu

Copyright@2004-2005 www.zzcoke.com All Right Reserved

advanced web statistics