I have dynamically generated buttons with url
using data attributes
<button class="btn-Add" type="button" data-add-url="/AddProductToCart?mobileNo=__param__&
productId=2051&quantity=1">Add to Cart</button>
I have the following code:
$(document).ready(function () {
var mobileNo = 0;
$(".btn-Add").click(function () {
mobileNo = $(this).parent('.pro-Group').find('input[type=text]').val();
var postURL = $(this).data('add-url');
postURL.replace('__param__', mobileNo);
alert(postURL); // i can still see __param__ , its not replaced
});
});
Why query string value is not replaced after using replace method ?