/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] Javascript do not work in FF !?

Hi I have the fallowing script..

Work ok in IE but do not work in FF.. anyone know why this issue !?

<script type= “text/javascript”>

maxL=255;
function taLimit(taObj) {
if (taObj.value.length==maxL) return false;
return true;
}

function taCount(taObj,Cnt) {
objCnt=createObject(Cnt);
objVal=taObj.value;
if (objVal.length>maxL) objVal=objVal.substring(0,maxL);
if (objCnt) objCnt.innerText=maxL-objVal.length;
return true;
}
function createObject(objId) {
if (document.getElementById) return document.getElementById(objId);
else if (document.layers) return eval(“document.” + objId);
else if (document.all) return eval(“document.all.” + objId);
else return eval(“document.” + objId);
}
</script>

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@FangJul 17.2008 — innerText is MS propriety, Fx uses the w3c textContent, but you are better off using:if (objCnt) objCnt.firstChild.data=maxL-objVal.length;
//or
if (objCnt) objCnt.innerHTML=maxL-objVal.length;

Depends on the context.
Copy linkTweet thisAlerts:
@liccyauthorJul 17.2008 — Thx +++ ?) is working..
×

Success!

Help @liccy spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.24,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...