This is useful in a corporate environment where you may want to define a set of standard favorites and download them to the user's browser when they access the corporate Intranet.
Both arguments are mandatory so you must specify the direction and server location. This also requires that you have a server set up correctly to handle these requests.
The flag value should be false to save the favorites list and true to restore from the server.
When the method is called, the browser will ask you to confirm that you want to upload or download the favorites collection. The server needs to be carefully set up to erase any favorites that were previously stored unless you want to gradually accumulate a larger and larger collection of stored favorites. This deletion on the server does not propagate into the browser and any favorites retrieved from the server are merged with the existing set in the client browser.
It is not clear from the documentation whether duplicates are eliminated and if they are not, then it is likely that a later version of the browser would provide this capability.
If you do not specify a location value, then the browser will open a file dialog so you can import and export to the local file system. You must still provide an argument, but it can be an empty string to trigger this behavior.
Oddly, this method can both save and retrieve the favorites using a flag value to determine the direction. This is slightly unusual and many similar actions in JavaScript provide one method to save and another to restore. You need to be constantly on the lookout for these kinds of inconsistent behaviors when developing JavaScript applications.
Prev | Home | Next |
external.AutoScan() | Up | external.IsSubscribed() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. |