I dont know how to show my values in ajax.Here my example
function check_valid() {
$.ajax({
url : '/something',
datatype : 'json',
async : false,
success : function(status) {
#status = ["1","abcdef"]
if (status[0] == 1) {
$("#check").css({
"display" : "block"
});
$("#com").html("Complete in #{status[1]}").css({
"display" : "block"
});
}
},
});
}
I want to show status[1]
in $("#com")
, but when I run app in sever it just show this:
Complete in #{status[1]}
I don't know how to show status[1]
in client. Please help me to fix that. I use ruby on rails. here my html:
<p id="com" style="display: none"></p>