Simple getJSON does not work...
- by user54197
JSON function(Index) does not fire. Any Ideas?
<script type="text/javascript">
$(document).ready(function() {
alert("This alert is displayed :(");
$("form[action$='GetQuote']").submit(function() {
$.getJSON($(this).attr("action"), $(this).serialize(), function(Result) {
alert("This alert is not shown :(");
$("#name").html(Result.name);
$("#address").html(Result.address);
});
return false;
});
});
</script>
CONTROLLERS...
public JsonResult GetQuote(string dataName)
{
if (dataName != "" || dataName != null)
return new JsonResult { Data = new Result { name = "Hello", address = "World" } };
else
return null;
}