Wh ydoesn't this JavaScript work in Firefox?



               

               2.0.0.6 for Windows,Mac,Linux

Question:Note that some of the space-out characters were intentional, due to yahoos character stripping.

onload = function setImg() {
var btnimgsrc = document.getElementById('btnSu...
btnimgsrc.setAttribute('s r c','h t t p :// www.website.com/ images/ buttons/ purchase.gif');
}


function swapImg(btn) {
var btnimgsrc = document.getElementById('btnSu...
if(btn==1) {
btnimgsrc.setAttribute('s r c',' h t t p ://www.website.com/ images/ buttons/ login.gif');
btnimgsrc.setAttribute(' disabled ',' disabled ');
}
}

HTML:
<form name="form1" method="post" action="test.html" enctype="text/plain">

<input type="image" id="btnSubmit" onclick="swapImg(1);" src="" />

</form>

Answers:
onload is microsoft slang.

window.onload is correct.


<html>
<head>
<title>
onload
</title>
<script type="text/javascript">
window.onload = function setImg() {
var btnimgsrc = document.getElementById ('btnSubmit')
btnimgsrc.setAttribute ( 'src', 'http://www.website.com/images/buttons/pu...
}


function swapImg(btn) {
var btnimgsrc = document.getElementById ('btnSubmit')
if(btn==1) {
console.log(btn)
btnimgsrc.setAttribute('src', 'http ://www.website.com/images/butt...
btnimgsrc.setAttribute( 'disabled','disabled');
return false;
}
}

</script>
</head>
<body>
HTML:
<form name="form1" method="post" action="test.html" enctype="text/plain" onsubmit="return false">

<input type="image" id="btnSubmit" onclick="swapImg(1);" src="somedefault.gif" />

</form>
</body>
</html>


becasue fire fox wont allow java because it could be a bad script...so you have to enable it
Have you downloaded IETAB add on for FireFox ?
https://addons.mozilla.org/en-us/firefox...
Go from FF to IE and test. your script.
The latest FF version is 2.0.0.4. & IE7. 7.0.5730.11
If a web site does not display properly
I switch over to IE showing the advts/flash displays etc.
para two : Please inform in which website of yours this script is incorporated .

Just want to remind you . Have you enabled JavaScript in FF. ?
Also when I updated FF today , while checking add ons
Java 6.0 ( for applets) has been disabled. ( diff from JavaScript)
Add-on QuickJava 0.4.2.1 which enables /disables both Java and JavaScript from Status Bar has passed the update compatibility.

More FireFox Questions & Answers...
  • Firefox 2.0.0.4 problems:why i couldn't login to Yahoo using firefox?
  • How to i see recently closed history on mozilla firefox?
  • I just got an answer for a question about Firefox and RealPlayer. But I don't think I posed the question. Why?
  • How can i uninstall my flash player plugin from firefox?
  • How to remove advertisement on a web page using firefox or IE7?
  • Mozilla Firefox browsing history doesn't match the actual times I was browsing those sites.?
  • Why is yahoo mail beta freezing up Firefox when it tries to load chat?
  • A new version of Netscaepe Navigator was just out and its based on firefox 2 are you people using it?
  • Which is a better browser - Mozilla Firefox, Sunbird, Thunderbird or Sea Monkey ?
  • Firefox isn't working?
  • This article contents is create by this website user, FireFoxAnswer.com doesn't promise its accuracy.