dkbailey1
asked on
How to pass a parameter with an '&' in the string using javascript?
I have a Javascript function that executes a webpage using ifrHidden.location. Sometimes a string with an '&' is being passed into the URL, but it doesn't work with a string like that. Is there a Javascript function that I can use to deal with this?
Thanks.
<script language="javascript" type="text/javascript">
function jsTierChange(urlpar){
if (urlpar == 'secondTier'){
ifrHidden.location = 'generateSecondTierList.cf m?firstTie r=' + document.workloadrecord.se lectProduc tListFirst Tier.value ;
makeHttpRequest('selectLis t1.html', 'alert');
}
else{
ifrHidden.location = 'generateThirdTierList.cfm ?secondTie r=' + document.workloadrecord.se lectProduc tListSecon dTier.valu e;
makeHttpRequest('selectLis t2.html', 'alert');
}
}
</script>
Thanks.
<script language="javascript" type="text/javascript">
function jsTierChange(urlpar){
if (urlpar == 'secondTier'){
ifrHidden.location = 'generateSecondTierList.cf
makeHttpRequest('selectLis
}
else{
ifrHidden.location = 'generateThirdTierList.cfm
makeHttpRequest('selectLis
}
}
</script>
dkbailey1,
Use the function urlEncodedFormat()
Regards
Plucka
Use the function urlEncodedFormat()
Regards
Plucka
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
glad i could help
thanks for the points
thanks for the points
Something you definitely could do is avoid the ampersands all together... http://developer.fusium.com/tools/ses.cfm
This converts the ?s and &s to just slashes, which is also far more search engine friendly. Cheers!