/    Sign up×
Community /Pin to ProfileBookmark

xml:lang and Lang problem in javascript

Hi Everybody,
I have been developing the javascript code for Toolbar. Below javascript code is working fine in Firefox Browser and the same code is giving error in IE 6.0. Please help solving this problem.

Javascript code is as below :
=========================================================

function LangService(){
var langattr,h,cnt=0;
var allTags=document.getElementsByTagName(“*”);
//Iterating the loop for all the tags present in the page
for (i=0;i<allTags.length;i++){
xlangattr=allTags[i].getAttribute(“xml:lang”);
langattr=allTags[i].getAttribute(“lang”);
if ((xlangattr !=null) && (xlangattr.length > 0)){
h=allTags[i];
var xx=h.innerHTML;
h.innerHTML='<span style=”color:#91060A;font:x-small bold;background:#FFFFC0;”><strong> xml:lang : &quot;’+ xlangattr+’&quot;</strong></span>’ + xx;
cnt++;
}//end if
if ((langattr !=null) && (langattr.length > 0)){
h=allTags[i];
var xx=h.innerHTML;
h.innerHTML='<span style=”color:#91060A;font:x-small bold;background:#FFFFC0;”><strong> Lang : &quot;’+ xlangattr+’&quot;</strong></span>’ + xx;
cnt++;
}//end if
}//end for loop

}
=========================================================

Thanx in Advance
Prasad

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @prasaddevivara 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.18,
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,
)...