Go Back   CodingForums.com > :: Client side development > JavaScript programming

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 05-22-2012, 07:47 AM   PM User | #1
Jian0203
New Coder

 
Join Date: Mar 2012
Posts: 47
Thanks: 2
Thanked 0 Times in 0 Posts
Jian0203 is an unknown quantity at this point
How to close .pdf in html iframe ?

I have a html where the user will just need to keyin the .pdf value and it will retrieve the file and it will be copied to local drive for certain reason. Once it's copied to local file, it will be display in IE. After the user has finished reading the .pdf, the user will click on one button to reload the html.

Now I want to add in a delete function to delete the local saved .pdf. When I try to call the function after my "window.location.reload()" , the delete function will definitely not running.

So, is it possible to close the .pdf file with javascript first, then delete the local saved .pdf, then here we reload the html ?

Thanks for suggestion.
Note : The .pdf will be display in the same window and same tab of IE. Whole html will be running in only one tab and window.

Code:
function reloadPage()
	{
		window.location.reload()
		remove();
		
	}

function remove()
    {
var sBnr = document.getElementById("txtBnr").value;
        var myObject;
        var fso = myObject = new ActiveXObject("Scripting.FileSystemObject");
        fso.DeleteFile("C:\\eBondingDiagram\\" + sBnr + ".pdf");
    }

Last edited by Jian0203; 05-22-2012 at 07:52 AM..
Jian0203 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 12:30 PM.


Advertisement
Log in to turn off these ads.