/    Sign up×
Community /Pin to ProfileBookmark

Destroy div object

I have script use to embed Flash object into HTML page (Flash Media Server).
I created div tags to contain them with seperate id for each.
When I destroy one div tag. (Call javascript function from Flash to destroy). It destroys all div objects in page (Firefox). this is wrong. Although it’s right in IE.
I don’t know why. Anyone knows it?

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@hyperliskApr 12.2006 — <i>
</i>DIVtoRemove = document.getElementById("removeMe");
document.body.removeChild(DIVtoRemove);

Try that.
Copy linkTweet thisAlerts:
@mak123authorApr 12.2006 — thks hyperlisk

I did like that, if you call this function from your page, it's ok (firefox + ie), but when you call function from Flash Media, it's error.

I can't understand.

So which is different between call javascript function from Flash and site?

It makes me very confused
Copy linkTweet thisAlerts:
@hyperliskApr 12.2006 — I do not know. I have no experience with Flash...
Copy linkTweet thisAlerts:
@KorApr 12.2006 — When removing a childNode you must remove it from its direct parent, or body might not be the direct parent of that div. Try this

var DIVtoRemove = document.getElementById("removeMe");

DIVtoRemove.[B]parentNode[/B].removeChild(DIVtoRemove);
×

Success!

Help @mak123 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.19,
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,
)...