/    Sign up×
Community /Pin to ProfileBookmark

noob IE javascript question: "Object dosen’t support this property or method"

var topicText = document.createElement(“span”);
topicText.setAttribute(‘class’, ‘current’);

[COLOR=”Red”]topicText.appendChild(document.createTextNode(String.concat(‘ – ‘, lastText)));[/COLOR]

so… this works in Firefox… why do i get this in IE???? (the red text is the line which IE complains about)

? ?

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@gil_davisFeb 04.2008 — Apparently IE's JScript "concat()" function is not the same as FF's. ?

Just use the "+" sign and be done with both browsers:
<i>
</i>topicText.appendChild(document.createTextNode(" - " + lastText));
Copy linkTweet thisAlerts:
@ZeroKilledFeb 04.2008 — you should never call a method within a class object unless that method is static, e.g. the method [B]fromCharCode[/B]. however, if you want to call a method that isn't static within the object, most probably you should use the [B]prototype[/B] object:

String.prototype.concat(...)
Copy linkTweet thisAlerts:
@lamdkauthorFeb 04.2008 — hmmmm alright... thanks for the fast responses

? ? ? ?
×

Success!

Help @lamdk 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 6.13,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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