When I load a page, there is a link “sameLink” that I want to append to it the query string of its containing page.
I have following URL:
somedomain/reporting/article-by-month?variable1=2008
How can I do that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To capture the QUERY_PARAMS that were part of the request, you reference the dict that contains those parameters (
request.GET) and urlencode them so they are acceptable as part of an href.request.GET.urlencodereturns a string that looks likeds=&date_published__year=2008which you can put into a link on the page like so: