This part I didn't figure out yet.
In a webpage I have a dropdown menu that calls a jquery function.
The jquery function calls a webpage changesite.wp
changsite.wp is a function that has VFP code in it.
If I select an option from the dropdown menu, the query code will run, then finish running the foxpro code from "changesite.wp", and then I get a blank page and the address box shows that it went to the webpage "changesite.wp".
How can I get it to remain in the screen that has the dropdown?
Thanks in advance.
Can you post the jQuery code calling changesite.wp
?
Thank you for responding. Here is the code:
<script src="bower_components/jquery/dist/jquery.min.js"></script>
<script>
function wlgsite(val)
{
var whatever = val.substring(0, 5);
if (whatever=='Chang'){
location.reload();
}else{
window.location.href = "changesite.wp?id="+val;}
}
</script>
you probably need an AJAX request:
function wlgsite(val)
{
var whatever = val.substring(0, 5);
if (whatever=='Chang'){
location.reload();
}else{
jQuery.ajax("changesite.wp?id="+val, {success:function(response){process response;}});
}
}
response is whatever changesite.wp
returns in response.write()
changesite.wp wasn't being called with:
jQuery.ajax("changesite.wp?id="+val, {success:function(response){process response;}});
So I just changed it to
jQuery.ajax("changesite.wp?id="+val)
Which ran changesite.wp. However,
cId = Request.Params("id")
generates an error. "Operator operand type mismatch".
How do I get the value of "val"?
Thanks for helping me.