I am trying to pass the var value from the function to the AJAX URL
function gonative_onesignal_info(info) {
//var pushid = info.installationId;
//var subscribed = info.oneSignalSubscribed;
// EXAMPLE
var subscribed = true;
var pushid = "123456789";
}
if (subscribed === true) {
$.ajax({ url: "ajax.php?push=" + pushid + "&key=<? echo $userkey; ?>",
context: document.body,
success: function(){
}});
}
only the php value is working for me but so in the console log it display like this: ajax.php?push=" + pushid + " instead of ajax.php?push=123456789