Hi I am one of teh newbee to programming. I am trying to use “onclick” event on a url as below.
[CODE]
<li><a href onclick=”javascript:callConfirm();”>Add a Project</a></li>
And my java function in a file which is included in the above jsp file look as below:
[CODE]
function callConfirm(){
var answer = confirm(“Accept or Decline”);
if(answer){
window.location ='<a href=/admin/addProject></a>’;
}
else {
window.location ='<a href=/></a>’;
}
}
I even tried with giving a location (window.location) as “http:www.google.com”;
Both of them are not working but when I click my url(Add a Project) I am getting a confirmation window. But after that it is not not relocating to respective pages. Please tell me where I went wrong?