One.
Document.all is a collection of all elements within a page. For example:
document.all (0) represents the first element within a page
Two.
Document.all can tell if the browser is IE
if (document.all) {
Alert ("is ie!");
}
Three.
You can also set the ID property (ID=AAAA) for an element and then call the element with DOCUMENT.ALL.AAAA
Four.
Case:
Code Listing 1:
Copy CodeThe code is as follows:
<input name=aaa value=aaa>
<input id=bbb value=bbb>
<script language=jscript>
Alert (Document.all.aaa.value)//Take value by name
Alert (Document.all.bbb.value)//Based on ID take value
</script>
Code Listing 2:
But often the name can be the same (for example, using a checkbox to take a user's many hobbies)
Copy CodeThe code is as follows:
<input name=aaa value=a1>
<input name=aaa value=a2>
<input id=bbb value=bbb>
<script language=jscript>
Alert (DOCUMENT.ALL.AAA (0). Value)//display A1
Alert (DOCUMENT.ALL.AAA (1). Value)//Display A2
Alert (DOCUMENT.ALL.BBB (0). Value)//This line of code will fail
</script>
Code Listing 3:
In theory, the IDs in a page are not the same, if there are different tags have the same id
Document.all.id will fail, just like this:
Copy CodeThe code is as follows:
<input id=aaa value=a1>
<input id=aaa value=a2>
<script language=jscript>
Alert (Document.all.aaa.value)//show undefined instead of A1 or A2
</script>
Code Listing 4:
For a complex page (the code is very long, or the ID is generated automatically by the program), or a
JavaScript Beginners Write the program, it is likely to appear two tags have the same ID case.
In order to do the programming without error, I recommend this way:
Copy CodeThe code is as follows:
<input id=aaa value=aaa1>
<input id=aaa value=aaa2>
<input name=bbb value=bbb>
<input name=bbb value=bbb2>
<input ID=CCC value=ccc>
<input name=ddd value=ddd>
<script language=jscript>
Alert (document.all ("AAA", 0). Value)
Alert (document.all ("AAA", 1). Value)
Alert (document.all ("BBB", 0). Value)
Alert (document.all ("BBB", 1). Value)
Alert (document.all ("CCC", 0). Value)
Alert (document.all ("ddd", 0). Value)
</script>
The table or column for which the filter was deleted.
Notes
This function cannot be used by itself, but as a temporary function that can be used to change the execution result set of some other calculation.
< topic Status: Some of the information in this topic is pre-release documentation and may change in future releases. Pre-release information describes the new features of Microsoft SQL Server 2014 Community Technology Preview 1 (CTP1) and changes to existing features. If you mark [column] as a date column by using Mark as Date table
You can use the all and allexcept functions in different environments, as described in the following table.
|
Functions and usage |
Description |
|
All (Table) |
Removes all filters from the specified table.
This function is useful when you are using a grouping with many levels and want to create a calculation that creates a ratio of aggregate values to a total value. The first example demonstrates this situation. |
|
all (column[, column[, ...]) |
Deletes all filters for the specified column in the table, and all other filters for other columns in the table are still applied.
This all (column) variable is useful when you want to delete a context filter for one or more specific columns and you want to keep all other context filters.
The second and third examples illustrate this scenario. |
|
Allexcept (Table, Column1 [, Column2] ...) |
Removes all context filters in the table, except those that have been applied to the specified column.
This is a quick and easy method when you want to delete a filter for many columns (but not all columns) in the table. |
JS's document.all function Use example