Forum Moderators: open
I have a question to ask to those who know how this works properly. How can I delete objects in an DHTML page using javascript and yet ensure compatibility between browsers?
You know, I am not particularly interested on using:
.
:
.
if(document.all)
(if(document.all[elem])!= null)
delete document.all[elem];
.
:
. Can anyone please help me? I would appreciate it alot!
Thanks in anticipation,
d#Nimrod
I really thought you could remove the actual element's object using Javascript.
Ok, let's back up a bit :) In your initial post you said:
How can I delete objects in an DHTML page using javascript and yet ensure compatibility between browsers
The answer to that is that you can't. Yes, you can delete objects (and any element on the page) using JavaScript, but not while maintaining compatibility between browsers. Do you see where I'm getting at, and the difference between the two?
If you're only concerned about actually being able to do it -- great! It can be done using JavaScript. But, don't expect all browsers to behave the exact same way. They all offer different levels of JavaScript support, especially related to more advanced DOM modifications, innerText/innerHTML modifications, nodes, etc.
Plus, to take it one step further -- you will always run into someone who doesn't have JavaScript enabled. Make sure whatever functionality you're trying to create can be done without for those users.
Ok, let's back up a bit In your initial post you said:How can I delete objects in an DHTML page using javascript and yet ensure compatibility between browsers
The answer to that is that you can't. Yes, you can delete objects (and any element on the page) using JavaScript, but not while maintaining compatibility between browsers. Do you see where I'm getting at, and the difference between the two?
But thanks Doc for enlighting me. I thought it could be done (although I did not know how).