IfMatch() FunctionPerforms a string match and if true, performs a specified action. Syntax:IfMatch(string,match,action) Parameters:
Remarks:
Example: In the following example, the IfMatch() function is used to place a notice on the toolbar if a user visits a page on the trellian.com domain. <xml id="toolbar"> <toolbar caption="IfMatch() Example"> <control type="toolbar"> <button
id="button1" action="http://www.trellian.com" onload="IfMatch($URL,'trellian.com',SetCaption(button1,'Latest Release!!!'); SetParam(button1, "action",'http://www.trellian.com/download.com'))"> </button> </control> </toolbar> </xml> When ever a new page is loaded, the onload= event trigger executes the IfMatch() function. If the URL of the page matches the specified URL, in this case 'trellian.com', the button caption is changed. The second function SetParam() changes the button's default action. Note the use of the $URL system variable to compare the currently loaded page. Compatibility: Requires ToolbarBrowser version 2.3.1 or later. In versions prior to 2.3.1, the else parameter is ignored. |