Use this technique when you want the Viewer API calls to be made as a result of an action in the calling page, but you do not want to reload the page. For example, you may have a page that generates a list of locations and you would like the user to be able to jump directly to any location, while leaving the list still available in the task pane.
In this case, your page can load another page in the hidden script frame, using target="scriptFrame" as part of the <a> tag. This requires that you create a separate page to load in the script frame and that you pass the necessary parameters when the page loads.
For example, the sample application includes a page named gotopoint.php. This is designed to be run in the script frame. The <body> element is empty, so the page does not produce any output. Instead, it emits a JavaScript function to execute when the page loads. This function calls the ZoomToView() function in the Viewer API.
To execute gotopoint.php from another page, create a hyperlink that passes the coordinates and zoom amount as HTTP GET parameters. Set target="scriptFrame". When a user clicks the link, gotopoint.php is loaded in the script frame, but the calling page does not change. For example, the following could be included as part of a page in the task pane:
<a href="gotopoint.php?X=-87.7116768&Y=43.7766789973&Scale=5000"
target="scriptFrame">Position map</a>