Forum Moderators: open
<td align="center">
<a href="javascript: void(0);" id="browse">Browse</a> ¦
<a href="javascript: void(0);" id="clear">Clear</a> ¦
<a href="javascript: void(0);" id="upload">Upload</a> ¦
<a href="javascript: void(0);" onclick="javascript: opener.location.reload(true); window.close();">Close</a>
</td>
Bu when i've clicked the Browse it was giving error. Link doesn't work for me. But my friend tried it. He says it works. So what is the problem? What can i do for work for me?
The first 3 links should be right as they are. Not wise, but they are OK.
I guess the code you pasted above is in a popup window, cos else has no meaning. So, the 4th link has some issues.
1. remove the 'javascript:' from the onclick event, no need for it.
2. in the highest location of the DOM tree there's no opener. It's in the window "branch". So your event should look like:
onclick="window.opener.location.reload(); window.close();"
I missed the true from the reload(), as far as I know it's not needed.
Hope this helps
Yes this page is in a popup window. I've deleted 'javascript:' and used onclick="window.opener.location.reload(); window.close();" But i still have same problem. When i've clicked the "Browse" it gives this error:
Error
This problem is only for my PC. I mean this code works another PC. So i need different code for my PC. How can i change this code? Thanks...
[edited by: eelixduppy at 3:39 am (utc) on Jan. 10, 2009]
[edit reason] removed image [/edit]
function Parent() {
window.opener.location.href = window.opener.location.href;
if (window.opener.progressWindow){
window.opener.progressWindow.close()
}
window.close();
}
Then, the 4th link in your example should look like this:
<a href="#" onclick="Parent()">close</a>
This should close the pop-up window and refresh the opener parent. Not an A+ grade function, but works.
<form action="http://google.com" method="GET">
<input type="submit" value="some example" />
</form>
If you'd like to call a JS onclick event, then without form element and only onclick as I did with your 4th link.