Please login or register. Welcome to the Studio, guest!


Quick Links:


newBookmarkLockedFalling

Moose

Moose Avatar

****
Senior Member

449


August 2005
Both have not been prototyped to make things faster for me and not to mention to make the functions quicker to use for you. :P

First the insertAfter():


<script type="text/javascript">
<!--
function insertAfter(newstuff,insertguy){
if(insertguy.parentNode.lastChild.innerHTML == insertguy.innerHTML){
insertguy.parentNode.appendChild(newstuff);
} else if(insertguy.parentNode.lastChild.innerHTML != insertguy.innerHTML){
insertguy.parentNode.insertBefore(newstuff,insertguy.nextSibling);
}}
insertAfter(new object to be inserted,object to insert after);
insertAfter(new object to be inserted,object to insert after);
insertAfter(new object to be inserted,object to insert after);
//-->
</script>


fastinsertBefore():

<script type="text/javascript">
<!--
function fastinsertBefore(newstuff,insertguy){
insertguy.parentNode.insertBefore(newstuff,insertguy);
}
fastinsertBefore(new object,object to be inserted before);
//-->
</script>


Just read through the code and you shall understand. Pretty easy and simple yet makes things quicker in some ways. :)
Greg says:
Coding music...
Greg says:
Hmm...
Greg says:
I wouldn't rule it out. :P
Chris 3.0 [New features? Yes.] says:
:P
Greg says:
If you think about machine code it's a bunch of 1s and 0s
Chris 3.0 [New features? Yes.] says:
Anything is possible.
Greg says:
Yeah try to code Metallica
Chris 3.0 [New features? Yes.] says:
:P Yeah, I'll get right on that... right after I learn to fly.

newBookmarkLockedFalling