I making a site, but I don't know how to write crossbrowser code.This works fine in Firefox, but don't in IE...I tried to improve the code by doing like I've seen other's do, like adding the short if statement...
//IDKfunction updatetitle(){ if (ie4||ns6){ var titletext=document.getElementById? document.getElementById("titletext") : titletext; var theiframe=document.getElementById? document.getElementById("theiframe") : theiframe; var leftline=document.getElementById? document.getElementById("leftline") : leftline; var rightline=document.getElementById? document.getElementById("rightline") : rightline; titletext.innerHTML=theiframe.contentDocument.title; var titlelength=theiframe.contentDocument.title.length; leftline.width= 350 - titlelength * 5; rightline.width= 310 - titlelength * 5; }}}
How do I make it work?titletext is a spanthe lines are imgI'm an experienced programmer, but javascript is to messy, almost messier that asm...