set url value globaly in javascript or jquery? -


i have calculate bonus. on first page 2 options: yes , no.

if select yes, piccal.html?value=yes

<a onclick="window.location.replace('piccal.html?value=yes')"> 

when select no, piccal.html?value=no

<a onclick="window.location.replace('piccal.html?value=no')"> 

if have yes calculate bonus otherwise not

on calculator page there 3 links other pages.

<a href="piccal.html" class="btn noselect"></a>          <a href="picinfo.html" class="btn noselect">pic grant information</a> <a href="#">contact us</a> 

piccal.html calculator page if select link inside have no value "yes" or "no" . how set url yes or no value default page if value selected page

i think getting question. in advance

if you're asking think, want persist querystring page page. can simple or involved, depending on many other factors, simple answer work if none of links have querystrings in them.

jquery(function($) {     if (location.search !== "") {         $("a").each(function() {             this.href += location.search         });     } }); 

put code in js file , include in every page need persist querystring. add querystring href value of every link on page. perfect? absolutely not, resolve particular scenario describe.


Comments

Popular posts from this blog

c# - How to get the current UAC mode -

postgresql - Lazarus + Postgres: incomplete startup packet -

javascript - Ajax jqXHR.status==0 fix error -