People,
I just saw this at The grabber states
I found this snippet interesting because study of it should be helpful to new JavaScript users and even for those of use who use it frequently, but not in the fashion shown in this snippet. Check it out:
The script covers browser compatibility issues with the document.all vs. document.layers if-blocks and seems to suggest that semi-colons aren't always needed.
Anyway, have a nice day!
--Dave
P.S., although I only glance at the newsletter anymore, they have a decent one. You can subscribe to it using the mini-form at the bottom of the page this snippet is on: or via the link I provided up top.
I just saw this at The grabber states
The document.getElementById method is very useful but isn't supported in early browsers. To define the method for use in those older browsers, just add this snippet to the beginning of your scripts.
I found this snippet interesting because study of it should be helpful to new JavaScript users and even for those of use who use it frequently, but not in the fashion shown in this snippet. Check it out:
Code:
<!-- ONE STEP TO INSTALL GETELEMENTBYID:
1. Copy the coding into the HEAD of your HTML document -->
<!-- STEP ONE: Paste this code into the HEAD of your HTML document -->
<HEAD>
<script type="text/javascript">
<!-- Begin
/* This script and many more are available free online at
The JavaScript Source!! [URL unfurl="true"]http://javascript.internet.com[/URL]
Created by: Ultimater :: [URL unfurl="true"]http://ultimiacian.tripod.com/[/URL]
Add this snippet to the very beginning of your script. */
if(!document.getElementById){
if(document.all)
document.getElementById=function(){
if(typeof document.all[arguments[0]]!="undefined")
return document.all[arguments[0]]
else
return null
}
else if(document.layers)
document.getElementById=function(){
if(typeof document[arguments[0]]!="undefined")
return document[arguments[0]]
else
return null
}
}
// End -->
</script>
<p><center>
<font face="arial, helvetica" size"-2">Free JavaScripts provided<br>
by <a href="[URL unfurl="true"]http://javascriptsource.com">The[/URL] JavaScript Source</a></font>
</center><p>
<!-- Script Size: 0.94 KB -->
The script covers browser compatibility issues with the document.all vs. document.layers if-blocks and seems to suggest that semi-colons aren't always needed.
Anyway, have a nice day!
--Dave
P.S., although I only glance at the newsletter anymore, they have a decent one. You can subscribe to it using the mini-form at the bottom of the page this snippet is on: or via the link I provided up top.