research diary
edim 2002
In conclusion:
Three methods where developed that would allow a user to dynamically select a visual style. Below are comparisons stating the advantages and disadvantages. The "viewing" page refers to page containing the visual and aural information (eg home page). The changing page refers to the page that updates the Coldfusion database.
Method One: The external variable page refresh method.
This method is a three-step method.
- User selects style link. Goes to coldfusion page.
- history.back takes user one step back.
- Javascript function renames window and reloads page.
Advantages
- Allows database to be updated
- Transparent process
- history.back function works across applications
Disadvantages
- Slow method, three steps
- Greater chances of errors
- Requires a separate cfm page for each style change.
Testing:
Internet Explorer 4.
Macintosh [failed] check history.back and location.reload
PC
Internet Explorer 5.
Macintosh [yes]
PC [yes]
Netscape 4.7
Macintosh [yes]
PC [yes]
Netscape 6
Macintosh [yes]
PC [yes]
Method Two: The internal page refresh method.
The second method developed was an extension of the first. If the window.name property can be tested and renamed why not use the property as a pseudo external variable. This method is the most eloquent method as it is only a one step process. It has the advantage of not requiring an external database or the use of cookies.
This method was a one step process.
- User selects style link. Window renamed and page reloads.
Advantages
- Speed one step
- Doesnt require cookies or an external database
- Relatively simple coding
Disadvantages
- Assumes that Browsers recognise the window.name property
- The only other window property that can be used is window.defaultstatus
Testing:
Internet Explorer 4.
Macintosh [yes]
PC
Internet Explorer 5.
Macintosh [yes]
PC [yes]
Netscape 4.7
Macintosh [failed] check location.reload
PC [yes]
Netscape 6
Macintosh [failed] check location.reload
PC [yes]
The third method developed used a query string and a time stamp to force
the viewing page to reload from the server and not the cache.
Method Three: The CGI query string method.
Advantages
- Appears to be a stable method
- Relatively quick
- Does not rely on window property or location.reload
Disadvantages
- Slow compared to method two
- Very long URL string in the browser window
Testing:
Internet Explorer 4.
Macintosh [yes]
PC
Internet Explorer 5.
Macintosh [yes]
PC [yes]
Netscape 4.7
Macintosh [yes]
PC [yes]
Netscape 6
Macintosh [yes]
PC [yes]
On testing it was found that the third method (CGI query string method)
was the most reliable on a Macintosh. Method 1 and 2 in Netscape proved
unreliable with the probably cause being the location.reload function. More
testing was done to find a cross application method of reloading a page.
A search was conducted to find an alternative, three possible solutions
where downloaded.
onClick='parent.location="javascript:location.reload()"
<a href="javascript:location.reload()" target="_self">reload page</a>
<a href="javascript: window.location.reload()">Reload Window</a>
The third one seemed the most suitable and tested successfully on using
Netscape on a Macintosh. The amended code for method two (internal page
refresh method) now reads.
<a href="javascript: window.name='medium'; window.location.reload()">medium</a>
The code was also amended for method one (external page refresh method)
<script language="javascript1.2">
function pageNew(){
var myWin=window.name;
if(myWin=='refreshpage')
{
window.name="bret";
var myWin=window.name;
window.location.reload();
}
}
</script>
The only method that seems buggy after the amended code is method one using
Internet Explorer 4 on a Macintosh. The probable cause is the browser not
recognising the history.back() function.