![]() |
Placing JS Variable in QueryString?
Hey guys,
I am trying to pass the scroll position between a couple pages. I have this code for placing it into a text field. But what I want to do is have it placed into a variable that I can then use in a link to a new page, the link will have the query string with the scoll position. This is a classic asp application, no so postback function can be used. Sessions are possible but I would prefer passing it through querystring. Code:
<script type='text/javascript'> |
How is that link activated?
Is it a simple Code:
<a href="someOtherPage.asp?scrollTop=xx"> go there </a>location.href = ... in JS code?Or are you *always* submitting a <form> to the ASP server? |
Quote:
I know how to make a link with a QS I just dont know how to make my scroll position function into a variable that I can use in the QS... I hope that makes sense.. :o |
Code:
<script type='text/javascript'>N.B.: In JS (and C and C++ and Java and ...) when you do a = b = c = d the assignment operations proceed right to left. So d is assigned to c which is assigned to b which is assigned to a. |
Quote:
About the element ID, its not needed. I dont know what the (e) is for either... :) Ill play around with this. I was not aware you could append and onlick event to a href like this. I think this will work perfectly. Thanks so much OP! |
Try this to retrieve the scroll position with a reload
Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> |
Quote:
|
Well, I of course knew what the e is, but I don't see why he needs it for that code.
Why does he need to reference the triggering event when the code just does (now, as simplified): Code:
<script type='text/javascript'> |
| All times are GMT +1. The time now is 12:39 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.