Wrox Programmer Forums
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 24th, 2004, 08:58 AM
Authorized User
 
Join Date: Oct 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default refresh

Hi,
I've got a problem
I have an asp page with a button.
When I click the button it calls a javascript function which use a window open to open an excel spreadsheet.
This works fine, but if I change the spreadsheet and I click the button again it doesn't reflect the last changes.
Why is that?

Thanks in advance

 
Old March 24th, 2004, 09:05 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Can we see a minimal example of the code you're using?

--

Joe
 
Old March 24th, 2004, 09:11 AM
Authorized User
 
Join Date: Oct 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

<html>
<head>
<javascript language="javascript">
function nav()
{
var a=window.open
("http://localhost/dashboard/dashreport/current/testmarc0704.xls")
}
</script>
</head>
<body>
<input type="button onclick="nav()">
</body>
</html>

 
Old March 24th, 2004, 09:54 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

It's probably because your browser has cached the page. You can try two things. Go to Tools|Internet Options|General Tab - middle section - settings. Change to 'every time you visit page'.
Or add a query string to the url:
Code:
function nav()
{
var sBaseUrl = "http://localhost/dashboard/dashreport/current/testmarc0704.xls";
var dt = new Date();
var iRandomInt = dt.valueOf();
var sFullUrl = sBaseUrl + "?q=" + iRandomInt;
var a=window.open(sFullUrl);

}
--

Joe
 
Old March 24th, 2004, 10:29 AM
Authorized User
 
Join Date: Oct 2003
Posts: 25
Thanks: 0
Thanked 0 Times in 0 Posts
Default

It works.
Thanks a lot for your help.






Similar Threads
Thread Thread Starter Forum Replies Last Post
Refresh GridView Using Refresh Button msbsam ASP.NET 2.0 Professional 0 December 6th, 2006 05:57 AM
refresh crmpicco HTML Code Clinic 7 January 31st, 2005 09:43 PM
Refresh surendran Javascript 7 August 3rd, 2004 05:31 AM
refresh kilika VBScript 0 September 16th, 2003 01:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.