SEARCH
0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
Prev | Current Page 1866 | Next

Joseph W. Lowery

"Dreamweaver CS3 Bible"

In the preceding example, the value
happens to be ???
???. You can insert any HTML code as the return value. However, because JavaScript
formats any value as a string, you apply JavaScript string-formatting syntax, as follows:
TIP TIP
NOTE NOTE
TIP TIP
TIP TIP
BC 11
Creating and Using Objects
n To use the objectTag() function to return an HTML tag and a variable, use quotes around
each string literal (but not around the variable), and join the two with a plus sign. For example,
the following objectTag() function code inserts in the
current cursor position:
nada = ???images/whatzit.gif???
return ??????;
n To make an object that returns separate lines of code, put each tag on its own line with the symbol
for a newline, \n, at the end of the string, surrounded by quotes; then add a plus sign at the
end of the line. For example, the following objectTag() function inserts a Flash movie of a
particular size and shape:
function objectTag() {
// Return the html tag that should be inserted
return ???\n??™ +;
???codebase=???http://active.Adobe.com/flash2/cabs/swflash.;
cab#version=4,0,0,0???. ???width=???145??? height=???135???> \n??™ + ;
???

Pages:
1854 1855 1856 1857 1858 1859 1860 1861 1862 1863 1864 1865 1866 1867 1868 1869 1870 1871 1872 1873 1874 1875 1876 1877 1878