India seo web development website designer freelance

identifyBehaviorArguments()

Description

Identifies arguments from a behavior function call as navigation links, dependent files, URLs, Netscape Navigator 4.0-style references, or object names so that URLs in behaviors can update if the user saves the document to another location and so the referenced files can appear in the site map and be considered dependent files for the purposes of uploading to and downloading from a server.

Arguments

theFunctionCall

This argument is the string that the applyBehavior() function returns.

Returns

expects a string that contains a comma-separated list of the types of arguments in the function call. The length of the list must equal the number of arguments in the function call. Argument types must be one of the following types:

Example

This simple example of identifyBehaviorArguments() works for the Open Browser Window behavior action, which returns a function that always has three arguments (the URL to open, the name of the new window, and the list of window properties):

function identifyBehaviorArguments(fnCallStr) { return "URL,other,other"; }

A more complex version of identifyBehaviorArguments() is necessary for behavior functions that have a variable number of arguments (such as Show/Hide Layer). For this version of identifyBehaviorArguments() , there is a minimum number of arguments, and additional arguments always come in multiples of the minimum number. In other words, a function with a minimum number of arguments of 4 may have 4, 8, or 12 arguments, but it cannot have 10 arguments.

function identifyBehaviorArguments(fnCallStr) { var listOfArgTypes; var itemArray = .getTokens(fnCallStr, '(),'); // The array of items returned by getTokens() includes the // function name, so the number of *arguments* in the array // is the length of the array minus one. Divide by 4 to get the // number of groups of arguments. var numArgGroups = ((itemArray.length - 1)/4); // For each group of arguments for (i=0; i < numArgGroups; i++){ // Add a comma and "NS4.0ref,IE4.0ref,other,dep" (because this // hypothetical behavior function has a minimum of four // arguments the Netscape object reference, the IE object // reference, a dependent URL, and perhaps a property value // such as "show" or "hide") to the existing list of argument // types, or if no list yet exists, add only // "NS4.0ref,IE4.0ref,other,dep" var listOfArgTypes += ((listOfArgTypes)?",":"") + ¬ "NS4.0ref,IE4.0ref,other,dep"; } }

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117

India web developer website development India