Forum Moderators: open

Message Too Old, No Replies

How I can retrieve a Hidden value in a self reloaded page

         

JohnnyDeauville

2:14 am on Feb 5, 2006 (gmt 0)

10+ Year Member



I have a page that reload himself with a post method and send a hidden value.

Is a little personal page, no ASP support in the ISP and only HTML/Javascript allowed on the pages.

How can I retrieve that with JavaScript?

DrDoc

2:30 am on Feb 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld! [WebmasterWorld.com]

JavaScript cannot access the POST variables. Either change the method to GET, or use PHP/Perl/ASP to retrieve the data.

One other option is to set the data in a cookie before reloading the page, and then read the cookie value upon refresh.

JohnnyDeauville

4:54 pm on Feb 5, 2006 (gmt 0)

10+ Year Member



What a shame. I consider another solution to the page load. I don't want to depend of the navigator security level.

But I'm relieved, because it's not possible to make that I want.

Thank you very much for the information.

Bernard Marx

5:36 pm on Feb 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I don't want to depend of the navigator security level.

I'm not sure of the exact stats (and I'd like to hear some views), but I think nearly all browsers will accept session cookies (not persistent).

You could get round the cookie problem by putting your data into the window.name. A technique supported by Rambo Tribble (see here [webmasterworld.com]). I think NS4 has a problem if the string contains spaces (but then who cares?).

DrDoc

6:42 pm on Feb 5, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Even sesion cookies can be turned off.
But, then again, so can JavaScript ...