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...