/    Sign up×
Community /Pin to ProfileBookmark

Add QueryString Values to Javascript Reload Question

Hi, I have a form that automatically reloads when drop downs are selected. I wanted to know if it’s possible to add QuesryString values on refresh.

Thanks

<script language=”javascript”>
<!–
function reload(){window.location.reload();}

function dept_onchange(frmSelect) {
frmSelect.submit();
};

//–>

</script>

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@A1ien51Feb 22.2009 — You would have to do something like

[CODE]var sep = (window.location.href.indexOf("?")===-1)?"?":"&";
window.location.href = window.location.href + sep + "foo=bar";
[/CODE]


Eric
Copy linkTweet thisAlerts:
@theflyingminstauthorFeb 22.2009 — Hi A1lien51. Awesome code, thank you!
×

Success!

Help @theflyingminst spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.3,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...