|
-
Jul 17th, 2009, 03:39 AM
#1
Thread Starter
Addicted Member
[RESOLVED] This means what
hi can anyone explain, this statement means what.. thanks 
The taller the bamboo grows the lower it bends... 
-
Jul 17th, 2009, 07:09 AM
#2
Re: This means what
Hi there JJJCR_FOX,
document.all is IE propriety code and this is it's definition...
A collection of elements nested within the current element.
A reference to document.all, for example, returns a collection (array)
of all element objects contained by the document, including elements
that may be deeply nested inside the document's first level of elements.
Here is an example...
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<meta name="language" content="english">
<meta http-equiv="Content-Style-Type" content="text/css">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<title></title>
<style type="text/css"></style>
<script type="text/javascript">
if(window.addEventListener){
window.addEventListener('load',init,false);
}
else {
if(window.attachEvent) {
window.attachEvent('onload',init);
}
}
function init() {
if(document.all){
for(c=0;c<document.all.length;c++){
alert(document.all[c].tagName);
}
}
else {
alert('document.all is not supported');
}
}
</script>
</head>
<body>
<ul>
<li>list one</li>
<li>list two</li>
<li>list three</li>
<li>list four</li>
</ul>
</body>
</html>
~ the original bald headed old fart ~
-
Jul 17th, 2009, 06:55 PM
#3
Thread Starter
Addicted Member
Re: This means what
ok, thanks for that..but i have seen a code with that statement with a question mark at the end of the statement..is a question mark a javascript operator or what? like ! it's a not operator in javascript, how about this ? it means what? thanks again...
The taller the bamboo grows the lower it bends... 
-
Jul 17th, 2009, 07:28 PM
#4
Fanatic Member
Re: This means what
Might be part of a statement using the javascript ternary operator.
The syntax for this is...
condition ? value if true : value if false
so the statement
document.all ? x : y;
means do x if document.all doesn't evaluate to false (i.e. is supported) or do y otherwise.
-
Jul 17th, 2009, 11:45 PM
#5
Thread Starter
Addicted Member
Re: This means what
ohhh..thank you so much for sharing your knowledge..
The taller the bamboo grows the lower it bends... 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|