T
tsangkinyip
hi,
i'm working on the following scripts My idea is whenever there's a
mouseover event on the series of links in one frame, the other frame
named "bookmarks" will load new content dynamically. however, when i
put the scripts into practice, some strange behavior happened. the
first time the mouse moved over "culture", it shows the related
bookmarks; but when the mouse moved on the another link eg.
"dictionary", i needed to move over it twice in order for the
"bookmarks" frame to refresh, & vice versa. can anybody help me how to
troubleshoot?
testing.js >>>>>
ie4_or_nn4 = (((navigator.appName == "Netscape") &&
(parseInt(navigator.appVersion) >= 4 ))
|| ((navigator.appName == "Microsoft Internet Explorer") &&
(parseInt(navigator.appVersion) >= 4 )))
nn3 = ((navigator.appName == "Netscape") &&
(parseInt(navigator.appVersion) == 3 ))
var activepage = ""
function showPage( bookmark ) {
if ( ie4_or_nn4 || nn3 ) {
if (activepage != bookmark) {
parent.bookmarks.location.href = 'bookmarks-main.html';
parent.bookmarks.showBookmark (bookmark);
activepage = bookmark;
}
}
}
function showBookmark( bookmark ) {
document.open();
document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"css/
general.css\">");
if (bookmark == "culture") {
document.write("<a href=\"http://www.soundportraits.org/\" target=
\"_blank\">Sound Portraits</a>");
}
else if (bookmark == "dictionary") {
document.write("<a href=\"http://dictionary.cambridge.org/\" target=
\"_blank\">Cambridge Online Dictionary</a>");
}
document.close();
}
categories.html (the frame that triggers the refresh on "bookmarks"
frame) >>>>>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<title>: : : M A R C O : B O O K M A R K S : : :</title>
<link rel="stylesheet" type="text/css" href="css/general.css">
<SCRIPT src="js/testing.js" type=text/javascript></SCRIPT>
</head>
<body>
<a class=locallink href="javascript:void(0);"
onMouseOver="showPage('culture')" style="line-height:2; padding-left:
1em; cursor:hand; color: #999999">culture</a><br>
<a class=locallink href="javascript:void(0);"
onMouseOver="showPage('dictionary')" style="line-height:2; padding-
left: 1em; cursor:hand; color: #999999">dictionary</a><br>
</body>
</html>
i'm working on the following scripts My idea is whenever there's a
mouseover event on the series of links in one frame, the other frame
named "bookmarks" will load new content dynamically. however, when i
put the scripts into practice, some strange behavior happened. the
first time the mouse moved over "culture", it shows the related
bookmarks; but when the mouse moved on the another link eg.
"dictionary", i needed to move over it twice in order for the
"bookmarks" frame to refresh, & vice versa. can anybody help me how to
troubleshoot?
testing.js >>>>>
ie4_or_nn4 = (((navigator.appName == "Netscape") &&
(parseInt(navigator.appVersion) >= 4 ))
|| ((navigator.appName == "Microsoft Internet Explorer") &&
(parseInt(navigator.appVersion) >= 4 )))
nn3 = ((navigator.appName == "Netscape") &&
(parseInt(navigator.appVersion) == 3 ))
var activepage = ""
function showPage( bookmark ) {
if ( ie4_or_nn4 || nn3 ) {
if (activepage != bookmark) {
parent.bookmarks.location.href = 'bookmarks-main.html';
parent.bookmarks.showBookmark (bookmark);
activepage = bookmark;
}
}
}
function showBookmark( bookmark ) {
document.open();
document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"css/
general.css\">");
if (bookmark == "culture") {
document.write("<a href=\"http://www.soundportraits.org/\" target=
\"_blank\">Sound Portraits</a>");
}
else if (bookmark == "dictionary") {
document.write("<a href=\"http://dictionary.cambridge.org/\" target=
\"_blank\">Cambridge Online Dictionary</a>");
}
document.close();
}
categories.html (the frame that triggers the refresh on "bookmarks"
frame) >>>>>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-16">
<title>: : : M A R C O : B O O K M A R K S : : :</title>
<link rel="stylesheet" type="text/css" href="css/general.css">
<SCRIPT src="js/testing.js" type=text/javascript></SCRIPT>
</head>
<body>
<a class=locallink href="javascript:void(0);"
onMouseOver="showPage('culture')" style="line-height:2; padding-left:
1em; cursor:hand; color: #999999">culture</a><br>
<a class=locallink href="javascript:void(0);"
onMouseOver="showPage('dictionary')" style="line-height:2; padding-
left: 1em; cursor:hand; color: #999999">dictionary</a><br>
</body>
</html>