Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can a querystring be changed without reloading page 1

Status
Not open for further replies.
No, if you could, hackers would be able to spoof other websites.

Adam
 
Adam, I'm not sure that I follow that reasoning. If I had a form in that page with action="mypage.htm" then I can certainly change the query string. I just want to do it from the page without reloading the page. Could you expain further? Thanks!

Clive
 
Of course you can change a value in a form, but what the heck does that have to do with trying to override browser functionality?!

Imagine you follow a link from a web site to another website that has been cleverly done up to look just like hotmail.com. If the author of the page had the ability to change the url in the address bar to " you'd have no indication that you were not actually there. Now the author has your hotmail password. See why this isn't allowed?

Adam
 
It doesn't matter, you still can't do it. Why would you want to? Maybe there's another way to do what you want.

Adam
 
Do you mean just for display purposes only or are you using the value in the querystring to do something else?

If you are not reloading the page then it doesn't seem like the "something else" would be on the server... so it must be client side.

If you need a place to stash some data why not a variable or hidden form field?
 

Hmmm... I wondering if there is a way to do this using frames? I don't know very much about frames and framesets (I tend to avoid them because they are so much trouble to manage)... but it would seem the ideal way to approach it.

Anyone else actually use frames? Any thoughts on how you might put a simple page together to mask URL / querystring changes without the user noticing.

Deep in thought in this,
Jeff

 
the URL (querystring inclusive) identifies a unique resource on the net. changing any part henceforth causes a new request.

if you are using the querystring parameters to control application state, then a new request would be the expected result of a change to any of them.

this is one of the caveats of using xmlrpc/xmlhttp/ajax/remote scripting, for you can cause client state to be out of sync with server state, e.g. your URL shows <foo.com/shop.html?product=1>, but you use ajax or similar to dynamically update just the picture to product=2. now the client is out of sync with the server as far as the URL is concerned. if the user bookmarks the current page expecting product 2, they will actually bookmark the URL for product 1.

-jeff
try { succeed(); } catch(E) { tryAgain(); } finally { rtfm(); }
i like your sleeves...they're real big
 
Clive,

Do you need to pull something else from a remote server or is it the case that your page already has everything it needs and you just want to change the presentation?
 
Sheco,

The page already has everything it needs I just want to change the querystring, which, if Jeff is right, "a new request would be the expected result of a change to any part of the URL".

So I guess we can close the thread. Thanks to all!


Clive
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top