Java script entities and firefox

This is a discussion on "Java script entities and firefox" within the JavaScript Forum section. This forum, and the thread "Java script entities and firefox are both part of the Program Your Website category.



Go Back   Webforumz.com > Main Forums > Program Your Website > JavaScript Forum

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Aug 10th, 2007, 23:15
New Member
Join Date: Aug 2007
Location: Egypt
Age: 24
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Java script entities and firefox

Hi,
i am new in JavaScript and have a small problem
i am currently reading the "JavaScript complete reference" e-book, and the following example, about JavaScript entities doesn't work on Firefox 2.0.06
it works fine on ie7. the code is as follows :
<head>
<script language="javascript1.5">
var Bordersize=5;
var tablecellcolor="#ff0000";
var alignment = "center";
function setImage (){
var today = new Date();
var hours = today.getHours();
if ((hours >8) && (hours < 18))
return 'Sunset.jpg'
else
return 'moon.jpg';
}
</script>
</head>
<body>
<table border="&{Bordersize };" align="&{alignment };">
<tr>
<td bgcolor="&{tablecellcolor };">Java script entities</td>
</tr>
</table>
In the sky now : <img src="&{setImage() };" />
</body>
The entities in red should reefer to the variables declared and initialized in the head tag, and it does so but only in ie7,
I need your help, does Firefox is not fully compatible with JavaScript, I don't think so !
Reply With Quote

  #2 (permalink)  
Old Aug 11th, 2007, 13:25
spinal007's Avatar
Moderator
Join Date: Mar 2004
Location: Good Ol'London
Age: 22
Posts: 1,619
Blog Entries: 1
Thanks: 0
Thanked 2 Times in 2 Posts
Send a message via ICQ to spinal007 Send a message via MSN to spinal007 Send a message via Yahoo to spinal007 Send a message via Skype™ to spinal007
Re: Java script entities and firefox

this functionality isn't part of javascript.
this is an IE only feature which you should stay away from.
Last Blog Entry: Random String in Javascript (Apr 21st, 2008)
Reply With Quote
Reply

Tags
firefox, java script entities

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Help with java script Pss JavaScript Forum 3 Mar 28th, 2008 21:17
Date Display - java script ksolanki Other Programming Languages 2 Mar 26th, 2008 09:51
I want ecards Java Script code. Anybody help 2 me. naagoo JavaScript Forum 1 Oct 28th, 2006 14:47
Java Script HELP!!!! dandaman2006 JavaScript Forum 1 May 22nd, 2006 10:07
Not sure this is a java script question? haans_gruber JavaScript Forum 7 Sep 3rd, 2005 01:56


All times are GMT. The time now is 06:05.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43