Page 1 of 1

Bug problem ampersand

Posted: Tue Mar 03, 2009 2:04 am
by texllmendo
Hi, i have some problem with the url ampersand for product, when i use http://......//index.php?route=product/product&product_id=51 for a link in javascript doesnt work, the & or ampersand is missing any suggest? thanks

Re: Bug problem ampersand

Posted: Tue Mar 03, 2009 10:16 am
by nde
URI encoding
& should be %26

Code: Select all

<script type="text/javascript">
var myaddr =
encodeURI("http://......//index.php?route=product/product&product_id=51");
document.write('<a href="' + myaddr + '">link<\/a>');
</script>
but where is the point in doing links with javascript?