User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the JSP section within the Web Development category of DaniWeb, a massive community of 427,437 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,691 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our JSP advertiser: Lunarpages JSP Web Hosting
Views: 5999 | Replies: 4
Reply
Join Date: Mar 2006
Posts: 2
Reputation: tazaramya is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tazaramya tazaramya is offline Offline
Newbie Poster

Help Need JavaScript/Firefox HELP

  #1  
Mar 19th, 2006
This script works in ie but NOT Firefox. Can someone help me make it work in both.

Script just creates and rotates the url that it uses. :mad:

<html>
<head>
<title>Corvallis Calendar - Home</title>

<SCRIPT LANGUAGE="JavaScript" type="text/javascript" >

<!-- //

var myDate = new Date();
var myMonth = myDate.getMonth();
myMonth = myMonth + 1;
var prefix = 'cal';
var CalURL = prefix + myMonth + '.html';

function rotate() {


window.location.reload(CalURL);

}

//-->

</SCRIPT>
</head>

<body onLoad="javascript:rotate()">

</body>
</html>
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Jun 2004
Location: H4x0rville
Posts: 2,105
Reputation: server_crash is on a distinguished road 
Rep Power: 9
Solved Threads: 18
server_crash's Avatar
server_crash server_crash is offline Offline
Postaholic

Re: Need JavaScript/Firefox HELP

  #2  
Mar 20th, 2006
You know that getMonth() returns a number. What do your URL's look like??
Reply With Quote  
Join Date: Mar 2006
Posts: 2
Reputation: tazaramya is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
tazaramya tazaramya is offline Offline
Newbie Poster

Re: Need JavaScript/Firefox HELP

  #3  
Mar 20th, 2006
I have created calendars for each month and this script is used to grab the current months file so for this month using this var CalURL = prefix + myMonth + '.html', CalURL should be cal3.html. I hope this clears up some confusion.

Taz
Reply With Quote  
Join Date: Mar 2006
Posts: 9
Reputation: Nilesh Pagar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
Nilesh Pagar Nilesh Pagar is offline Offline
Newbie Poster

Solution Re: Need JavaScript/Firefox HELP

  #4  
Mar 22nd, 2006
See that window.location.reload() is having problem..............

the definition says that........


relaod() --------- this is ok since you r not using this type.
reload(force) -------- but check out this one. force is the boolean handle.

and this is applicable for FireFox and Netscape......

so that is the reason its not working in FireFox......

Alternative:

use

window.location.replace(url)

this method to achieve your requirement.... i think this will meet your purpose.....

But just check out what replace(url) method does.....

The replace() method of the Location object causes the specified URL to be loaded and displayed, but instead of creating a new entry in the hisory array for that URL, it overwrites the URL of the current entry in the array

if this is fine for you u can use this replace() instead..........

Nilesh............
Reply With Quote  
Join Date: Mar 2006
Posts: 9
Reputation: Nilesh Pagar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
Nilesh Pagar Nilesh Pagar is offline Offline
Newbie Poster

Re: Need JavaScript/Firefox HELP

  #5  
Mar 22nd, 2006
do those changes....
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb JSP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the JSP Forum

All times are GMT -4. The time now is 5:32 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC