Hi, I’ve been trying to get an alert messge to fire after a successful ajax call. I confirmed that the action in my controller is called by placing a breakpoint in the action. However, the alert does not fire and I get no error messages.
Not sure if this is relivant but the code does not work in firefox browser. Here’s the script:
var theParms = { selectedDate: "date", testing: "myTester" };
$("#saveBtn").click(function () {
$.ajax({
type: "GET",
url: "/Error/TimeCheck",
data: theParms,
datatype: "html",
success: function (data) {
alert(data);
}
});
And here’s the controller:
public ActionResult Timecheck( string selectedDate, string testing)
{
return View ("hello " + selectedDate);
}
Also tried this:
public ActionResult Timecheck( string selectedDate, string testing)
{
return Content ("<script language='javascript' type='text/javascript'>alert('hello');</JavaScript>");
}
Could it be that I need to install some plugin to assist in an ajax call?