jQuery GET function does not execute.
I am using a Telerik Data grid that executes the following script when a row is selected
<script type="text/javascript">
function onRowSelected(e) {
IPAddressId = e.row.cells[0].innerHTML;
var dialogDiv = $('#result');
var viewUrl = '/IPAddresses/Edit/' + IPAddressId;
$.get(viewUrl, function (data) {
alert(viewUrl);
});
};
</script>
I have the alert inside the .get function for testing. I actually have other code I will place in there.
If I place the alert(viewUrl) above the $.get function, the alert displays however as it is shown above the alert does not get displayed.
Your $.get is correct.
It’s possible you are getting a 500 error, and you didn’t specify an error function to get called, so you never see it. Open your console (Firebug, Chrome Developer tools, etc) and go to the ‘net panel’. What does it say?