/    Sign up×
Community /Pin to ProfileBookmark

Urgent! What’s New in Cross-browser compatibility?

Dear All,
Very exciting – I have an interview next Monday for a job! It’s been over a year – I’ve been cable-dogging most recently. The interview will include a DHTML test which requires writing only for IE but adding in the Netscape stuff is a big plus! I last wrote compatible DHTML for Netscape 4. Can someone please summarize or point me to a good, succinct source of what’s new with Netscape 6/7 in cross-browser area?

Thanks many times over!

document.all.MyCareer.innerHTML = “<strong>I really want this job!</strong>”;

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@FangAug 24.2004 — The [URL=http://www.w3.org/DOM/]DOM[/URL] and a site that gives examples of [URL=http://www.quirksmode.org/dom/intro.html]what does and dosen't work[/URL]

document.all.MyCareer.innerHTML = "<strong>I only script for IE!</strong>"
Copy linkTweet thisAlerts:
@MikeFosterAug 25.2004 — And for examples of usage, browse thru several different cross-browser dhtml libraries ? (stick to the 'core' functions initially). While browsing thru the libraries take note of the standard and non-standard objects and methods utilized and refer back to the list at quirksmode.org.

Also to help your preparation, look for examples of "unobtrusive dhtml" and "Javascript closures". At least be somewhat familiar with those topics.

Good luck ?
Copy linkTweet thisAlerts:
@David_HarrisonAug 25.2004 — A DOM example:var career=docuemnt.getElementById("MyCareer");

var emphasis=document.createElement("strong");

var statement=document.createTextnode("innerHTML blows camels and document.all is IE only!");

emphasis.appendChild(statement);
career.appendChild(emphasis);
From what I've seen, IE keeps to the W3C DOM surprisingly well, so use it.
Copy linkTweet thisAlerts:
@TheRealMVPauthorAug 26.2004 — Making progress, but having a hard time finding a complete, easy-to-use reference site. For example, I have not found anything on what exactly are the attributes that can be used by setAttribute.

Why doesn't this work? The contents of the divs are being changed, but the style (I assume attributes are standard css?) is not being applied...

<code>

var newText= "this is now some text!";

var newHtml= "bold text is now here!";

var div1=document.getElementById('div1');

var div2=document.getElementById('div2');

div1.firstChild.nodeValue=newText;

div2.firstChild.nodeValue=newHtml;

div2.setAttibute('font-weight','bold');

div2.setAttibute('font-size','14pt');

</code>

?
Copy linkTweet thisAlerts:
@FangAug 26.2004 — Set the style:

div2.setAttribute("style", "font-size:20px;");

Two problems:

1) Not possible with IE

2) This method overrides ALL other style set in this way, so you can only do this once.

Better is to do it like this:

div2.style.fontWeight='bold';

div2.style.fontSize='14pt';

http://www.mozilla.org/docs/dom/domref/dom_style_ref.html#1000986
×

Success!

Help @TheRealMVP 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.17,
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,
)...