330 Part III . Document Objects Reference Methods (Web site development)
Friday, December 21st, 2007330 Part III . Document Objects Reference Methods assign( URL ) Returns: Nothing. Compatibility NN2 . NN3 . NN4 . NN6 . IE3/J1 . IE3/J2 . IE4 . IE5 . IE5.5 . In earlier discussions about the locationobject, I said that you navigate to another page by assigning a new URL to the locationobject or location.href property. The location.assign()method does the same thing. In fact, when you set the locationobject to a URL, JavaScript silently applies the assign()method. No particular penalty or benefit comes from using the assign()method, except per haps to make your code more understandable to others. I don t recall the last time I used this method in a production document, but you are free to use it if you like. Related Item: location.href property. reload(unconditionalGETBoolean) Returns: Nothing. NN2 NN3 NN4 NN6 IE3/J1 IE3/J2 IE4 IE5 IE5.5 Compatibility . . . The location.reload() method may be named inappropriately because it makes you think of the Reload/Refresh button in the browser toolbar. The reload() method is actually more powerful than the Reload/Refresh button. Many form elements retain their screen states when you click Reload/Refresh (except in IE3). Text and TEXTAREA objects maintain whatever text is inside them; radio buttons and checkboxes maintain their checked status; SELECT objects remember which item is selected. About the only items the Reload/Refresh button destroys are global variable values and any settable, but not visible, property (for example, the value of a hidden INPUT object). I call this kind of reload a soft reload. Browsers are frustratingly irregular about the ways they reload a document in the memory cache. In theory, an application of the location.reload() method should retrieve the page from the cache if the page is still available there (while the history.go(0) method should be even gentler, preserving form element settings). Adding a true parameter to the method is supposed to force an unconditional GET to the server, ignoring the cached version of the page. Yet when it is crucial for your application to get a page from the cache (for speed) or from the server (to guarantee a fresh copy), the browser behaves in just the opposite way you want it to windowObject.location.reload()
Note: In case you are looking for affordable and reliable webhost to host and run your j2ee application check Vision J2ee Web Hosting services.