
Hi All, I m creating a bookmark to capture the url of the site and the user's input in the bookmark,in javaScript.this url and user input is to be saved into DB. Following is my code.Result is not appropriate,what I need.Below is my code,where do I need to change it:
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Show all names</title>
<script type="text/javascript">
<!--
function bookmark(url, sitename)
{ document.write (document.location.href);
document.write (window.parent.document.location.hre);
ns="Netscape and FireFox users, use CTRL+D to bookmark this site."
if ((navigator.appName=='Microsoft Internet Explorer') &&
(parseInt(navigator.appVersion)>=4))
{
window.external.AddFavorite(url, sitename);
}
else if (navigator.appName=='Netscape')
{
alert(ns);
//document.write (document.location.href);
}
}
//-->
</script>
</head>
<body>
<form method="GET" action='Controller' name="showall">
<table>
<tr>
<td><input type="checkbox" name="id1" /></td>
<td>Jim</td>
<td>Knopf</td>
</tr>
<tr>
<td><input type="checkbox" name="id2" /></td>
<td>Jim</td>
<td>Bean</td>
</tr>
</table>
<p><input type="submit" name="delete" value="delete" />
<input type="submit" name="edit" value="edit" />
<input type="reset"
value="reset" /></p>
</form>
<a href="javascript:bookmark('http://www.mydomainname.com/',
'My Site Name');">Bookmark This Site</a>
</body>
</html>
Please suggest.
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.