How to close the popup window automatically after download completes

shakemelikeapig

New Member
hi everyone,
i this sample i am having two links "click for pdf" and "click for doc". First if the user clicks on any of the link it should validate if the file is .doc or .pdf if it's .pdf file then a popup window should come and the .pdf file should open in it and if the user clicks on "click for doc" a popup window should come up and it should give u the option to download the .doc file and the popup window should automatically close. i am able to validate the file extension and the link "click for pdf" is working as it is suppose to. But if the user clicks on "click for doc" a popup window pops up i am not able to close that window after the download completes. Please "HELP ME!"

This is my Code Snippet:

<html>
<head>
<title>
</title>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.2.6/jquery.js"></script>

<script type="text/javascript">
var windowSizeArray = [ "width=200,height=200",
"width=300,height=400,scrollbars=yes" ];

$(document).ready(function () {
$("a[href*=.pdf]").click(function () {
window.open(this.href, "ventana1", "width=520,height=300,scrollbars=yes");
return false;
});

});
</script>

<script type="text/javascript">


var windowSizeArray = ["width=200,height=200",
"width=300,height=400,scrollbars=yes"];

$(document).ready(function () {
$("a[href*=.doc]").click(function () {
//
var ab = window.open(this.href, "ventana1", "width=520,height=300,scrollbars=yes");
//ab.close();
//ab.setTimeout("window.close();", 5000);
//ab.setTimeout("alert('I am displayed after 3 seconds!')", 200);
ab.setTimeout("self.close()", 3000);
return false;
});

});

</script>

</head>

<body>

<a href="http://java.sun.com/docs/books/jls/download/langspec-3.0.pdf" >click for pdf</a><br /><br />
<a href="http://www.google.co.in/url?sa=t&rct=j&q=.doc&source=web&cd=13&ved=0CD8QFjACOAo&url=http%3A%2F%2Fgrants.nih.gov%2Fgrants%2Ffunding%2F416%2Fphs416-5.doc&ei=s1VHT5tPhfCtB7a_zcgP&usg=AFQjCNEJfrh5P2gvHLSh7M03SYtBI91uNg" >click for doc</a>
</body>
</html>

Thanks in advance

SP
 
Similar threads
Thread starter Title Forum Replies Date
Digital Pandit Elliot Silver on advising someone close about buying domain names Resources 0
webmaster75 Close For Sale / Advertising 0
jedi Domain "Nibiru" may be close to earth ~~ NIBURU.us ~~ Non-India Related Domains 2
jedi Domain Wake up! "Nibiru" is getting close to earth ~ NIBIRU.in" For Sale 3
webmaster75 close Non-India Related Domains 0
webmaster75 close Non-India Related Domains 1
webmaster75 Close For Sale / Advertising 1
webmaster75 Close For Sale / Advertising 0
DNJournal.com Sedo Takes Top Spot on This Week's Sales Chart with Domain That Claimed Close to 6 Figures The Lounge 0
JulienJ China: After Banning Exchanges, Authorities Move To Close ‘Exchange-Like Services’ Cryptocurrencies 0
JulienJ NameJet Scores a COOL $3K Emoji Domain Auction Close The Lounge 3
webmaster75 close Non-India Related Domains 0
webmaster75 close Non-India Related Domains 0
webmaster75 close Non-India Related Domains 1
D Close my account The Lounge 2
webmaster75 Close Non-India Related Domains 0
webmaster75 Close Non-India Related Domains 1
webmaster75 Close Non-India Related Domains 0
webmaster75 Close Non-India Related Domains 1
domainking131 With DNForum down close to a week members are losing deals Non-Indian Domains 2
webmaster75 Close Non-India Related Domains 0
webmaster75 Close Non-India Related Domains 4
DNJournal.com 2-Character .Com Leads New Sales Chart with 6-Figure Sale - Quartet of 3-Letter .Coms Close Behind The Lounge 0
domainking131 Close to 3.1 Million Domain Names Registered in the Third Quarter of 2015 Non-Indian Domains 0
domainking131 55588.net heats up at the close and finishes at $2,602 Non-Indian Domains 0
webmaster75 CLOSE Non-India Related Domains 8
DomainSherpa Sales Persistence: 120 Contacts to Close a Single Sale – With Joe Uddeme The Lounge 0
jedi Domain ADMINISTRATION: A request. Please close old selling threads.. The Lounge 3
domainking131 NameJet reports close to $800,000 in domain sales in January 2015 Non-Indian Domains 2
domainking131 UK police close down 2,500 domain names that were selling counterfeit products Non-Indian Domains 0
jedi Domain A great deal on expiring or close to expiring GO DADDY domains.... Non-India Related Domains 0
DNJournal.com Christmas Comes Early at Sedo With $233,000 Sale - Much Bigger Deal About to Close? The Lounge 4
Digital Pandit "popup.io" is on sale - Go check out Auctions 0
Digital Pandit Live Auction: Place your bids for "popup.io" on Park.io New GTLDs 0
DomainSherpa DomainSherpa Review – Jun 20: Extract.com, Seed.cc, Popup.io, TRRC.com… The Lounge 0
anquest SHISHA.com Sells For US$190K (Hindi for 'Window(s)/Glass') | HINDIweb.com For $35K General Indian Domain Name Discussion 0

Similar threads

whois



Forums dedicated to Indian domain names, including buying, selling, appraising, developing, and monetizing.

About Us

Threads
27,575
Messages
74,676
Members
7,680
Latest member
SSDcension
Top Bottom