473,387 Members | 1,664 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

A simple javascript code not working on Firefox

Hello,

I have a code that works on both the IE and Opera, but not the
Firefox, and I cannot figure out the reason. Following is the page:

http://www.pinyinology.com/test/span2.html

And following is the code:

function chinText()
{
document.getElementById("moon").innerText ="\u6708";

document.getElementById("tree").innerText ="\u6728";

document.getElementById("man").innerText ="\u4eba";

document.getElementById("water").innerText ="\u6c34";
}

Thanks for your expertise and help.
fulio pen
Sep 9 '08 #1
3 1192
On Sep 9, 7:37*am, fulio pen <fulio...@yahoo.comwrote:
Hello,

I have a code that works on both the IE and Opera, but not the
Firefox, and I cannot figure out the reason. *Following is the page:

http://www.pinyinology.com/test/span2.html

And following is the code:

function chinText()
{
* document.getElementById("moon").innerText ="\u6708";

document.getElementById("tree").innerText ="\u6728";

document.getElementById("man").innerText ="\u4eba";

document.getElementById("water").innerText ="\u6c34";

}

Thanks for your expertise and help.
fulio pen
Firefox does not support the innerText function. You can use an
alternative, (like innerHTML) which is also not standard, but
supported in most browsers.

Sep 9 '08 #2
On Sep 9, 7:49*am, Tom Cole <tco...@gmail.comwrote:
On Sep 9, 7:37*am, fulio pen <fulio...@yahoo.comwrote:
Hello,
I have a code that works on both the IE and Opera, but not the
Firefox, and I cannot figure out the reason. *Following is the page:
http://www.pinyinology.com/test/span2.html
And following is the code:
function chinText()
{
* document.getElementById("moon").innerText ="\u6708";
document.getElementById("tree").innerText ="\u6728";
document.getElementById("man").innerText ="\u4eba";
document.getElementById("water").innerText ="\u6c34";
}
Thanks for your expertise and help.
fulio pen

Firefox does not support the innerText function. You can use an
alternative, (like innerHTML) which is also not standard, but
supported in most browsers.
Hi, Tom:

innerHTML works well. Thanks a million for your help.

fulio pen
Sep 9 '08 #3
Tom Cole wrote:
Firefox does not support the innerText function.
Correct, except that it is a non-function property of element objects.
You can use an alternative, (like innerHTML) which is also not standard,
but supported in most browsers.
`firstChild.nodeValue' (W3C DOM Level 1+) would probably be a viable
alternative here. `textContent' (W3C DOM Level 3 Core) is AFAIK supported
since Gecko 1.7.8 (Firefox 1.5), Opera 9.0.8367, and Safari 3.0.4.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Sep 10 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Eric-Sebastien Lachance | last post by:
Hey there, I decided to just create a 100% height and width div that filled the space over a background header image, and add an onclick event to redirect to the my index... Doesn't seem to work...
27
by: one man army | last post by:
Hi All- I am new to PHP. I found FAQTS and the php manual. I am trying this sequence, but getting 'no zip string found:'... PHP Version 4.4.0 $doc = new DomDocument; $res =...
8
by: chrisdude911 | last post by:
how do i add video into a javascript web page with my own custom buttons?
7
by: Coder | last post by:
Hi I have the following code in java script, it is not giving proper output in FIREFOX but running fine in IE... can anybody help me out to make this run in FIREFOX . <script...
13
by: David Golightly | last post by:
I'm getting my feet wet with JavaScript 1.7 (Firefox 2.0 only) and messing around with it in the console, working through some of the exercises given at...
1
by: nitinp | last post by:
hello, I am trying to validate empty textbox value by javascript in Firefox. It is working fine in IE but not in Firefox. Note - code is for ASP.NET <script runat="server"> protected void...
12
by: tim | last post by:
I am using foldoutmenu 3 and am having problems with viewing my menus in firefox. On my sub3 menus i have more than one line of text in some places. firefox does not recognise that there is more...
2
by: barrymars | last post by:
First posting here so bear with me. i'm working on a double tabbed menu system for a web aplpication, where the first row of 'divs' control visibility of the second row of 'divs'. It all works...
3
by: Brucepanye | last post by:
<script type="text/javascript"> function disableOtherLinks(URL){ document.open(); document.writeln('html>Zbody bgcolor="#e6e6e6" >'); document.writeln('<p><h3>...
3
by: safiratec | last post by:
Hi, I want to show a div depending of the value of a <select> option, using 2 functions hidediv() and showdiv() - it is working fine in firefox, but not in IE (tested with IE 6 and 7). <body...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.