IfExactMatch() FunctionPerforms and exact string match. IfExactMatch(string,match,action,else) Parameters: string - string to match. Can include variables. match - string to match. Can include variables. action - action to take if a positive match is made. This can include one or more functions separate by a semicolon. else - alternate action to take if no match is made. This can include one or more functions separate by a semicolon. Remarks:
Example: In the following example, the IfExactMatch() function is used to change a toolbar icon and caption when a user visits a specific web page. <xml id="toolbar"> <toolbar caption="IfExactMatch() Example"> <control type="toolbar"> <button
id="button1" action="Highlight(query)" onload="IfExactMatch($URL,'http://www.toolbarbrowser.com/features.htm',SetCaption(button1,'Great Features'); SetIcon(button1, 'http://www.toolbarbrowser.com/img/smiley.ico'))"> </button> </control> </toolbar> </xml> When ever a new page is loaded, the onload= event trigger executes the IfExactMatch() function. If the URL of the page matches the specified URL 'http://www.toolbarbrowser.com/features.htm', the icon and caption of the toolbar button is changed. 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. |