Using window.location to change content on a page

B

Ben

Hello,

I'm trying to write a calendar control, just to get used to JavaScript, and
the code works just fine on IE. The problem is if I try to run the code on
Navigator 7.1 when I try to navigate either a month forward or a month
backward it simply redisplays the current month. I believe the problem is
in the line:

location.search = '?datetime=' + dtObj;

I'm simply trying to set the query string and passing in a timestamp. as the
query parameter.

on the .html page that I'm rendering I have the following code to extract
the datetime query value:

var re_url = new RegExp('datetime=(\\-?\\d+)');
var selectedDay = (re_url.exec(String(window.location)) ? new Date(new
Number(RegExp.$1)) : new Date());

From IE 6. I extract the querystring just fine, but in Navigator 7.1 when I
arrive on the page for the second time, the query value is blank!

Does anyone know the reason?

Thanks,
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,527
Members
44,998
Latest member
MarissaEub

Latest Threads

Top