Multiple script call from onClick event. Firefox probs.
First off, hi all, this is my first post... I'm a bit of a noob to this, so please bear with me.
I'm using a script (with inner HTML), to swap currencies. My onClick event calls two scripts to change the content of two cells. It works fine in IE, but Firefox... Nothing. I've run firebug, the error returned is "illegal character". This is basically chinese to me. I've copied the code below. Any help or guidance on this matter is very much apreciated. Best regards. Mark
<html>
<head>
<script type="text/javascript">
function changeContent1€(){
var x=document.getElementById('myTable').rows
var y=x[1].cells
y[1].innerHTML="1€"
}
function changeContent2€(){
var x=document.getElementById('myTable').rows
var y=x[2].cells
y[1].innerHTML="2€"
}
function changeContent1£(){
var x=document.getElementById('myTable').rows
var y=x[1].cells
y[1].innerHTML="1£"
}
function changeContent2£(){
var x=document.getElementById('myTable').rows
var y=x[2].cells
y[1].innerHTML="2£"
}
function changeContent1$(){
var x=document.getElementById('myTable').rows
var y=x[1].cells
y[1].innerHTML="1$"
}
function changeContent2$(){
var x=document.getElementById('myTable').rows
var y=x[2].cells
y[1].innerHTML="2$"
}
function changeContentRevert1(){
var x=document.getElementById('myTable').rows
var y=x[1].cells
y[1].innerHTML="$22,564m(AD)"
}
function changeContentRevert2(){
var x=document.getElementById('myTable').rows
var y=x[2].cells
y[1].innerHTML="$44,895(AD)"
}
</script>
The function names are invalid. The function name can contain only alphanumeric characters (alphabetic and digits) and the underscore and cannot begin with a number.
Code:
// bad
changeContent1€
// good
changeContent1Euro
At least 98% of internet users' DNA is identical to that of chimpanzees
Bookmarks