I am trying to implement a "post request get" pattern for SEO reasons. Therefore I want to pass values via jquery post to a php file which then returns a url that will be used for a get 302 redirect.
How could I access the values "prg=..." from the link inside the jquery function in order to pass it to the php script?
<script type="text/javascript">
$(function() {
$('.redir-link[prg]').click(function (e) {
request = $.ajax({
url: "/app_global/prg.php",
type: "post",
data: {
url: 'test',
url2: 'url2'
},
success: function (response) {
console.log("Hooray, it worked!"+response+this.prg);
window.location = response
},
});
});
</script>
<a prg="val-1|val2" class="redir-link" title="test">PRG Link test</a>