Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Mailto: redirection from server
Message
General information
Forum:
ASP.NET
Category:
Other
Environment versions
Environment:
C# 1.1
Miscellaneous
Thread ID:
01142834
Message ID:
01142927
Views:
9
>just add a javascript function to close the window:
>
>
><a href="http://myredirectingsite.com?URL=123456 onclick="closeme();">Send me an email</a>
>
>
>and in
<head>
section add:
>
>
><script language=javascript  type ="text/javascript" >
>function closeme()
>{
>   window.close();
>}
></script>
>


Correct. But I would add a set focus beforehand. If you don't, and the user has set the focus to a different program in between your first page and the one you are about to close, then when closing it, the page on the forefront would be the other program (maybe Excel or something), instead of the previous browser page. This could be confusing for some users.

Also in this example it is done inline. No need for a separate javascript function, which is only needed if you plan to so something complex and/or reusable. Either one works fine.
<a href="http://myredirectingsite.com?URL=123456 OnClick="javascript:window.opener.focus();window.close();">Send me an email</a>


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform