First get the value from the url into a php variable like this :
<?php
$x = base64_decode($_GET["prod_id"]);
?>
Then save this value into a hidden text field like this :
<input type="hidden" id="product_id" value="<?php echo $x; ?>">
Then get this value from the hidden textfield to javascript variable.
$(document).ready(function(){
$value = $("#product_id").val();
}
1
solved How to get base64 encoded value from url in javascript variable