2
성공과 실패 함수를 추가하고 싶습니다. 어떻게 할 수 있습니까? 이 코드는 다음과 같습니다.어떻게 성공 기능을 추가 할 수 있습니까?
class ={};
class.hey = function(values)
{
document.getElementById(values.id).innerHTML = values.Val ;
return class;
}
class.hey({
id:"target",
Val: "hello world",//this wil work and will display that value in the span tag
})
<span id="target"></span>//here will appear the value passed before
모든 것이 잘되었거나 잘못되었는지를 알려주는 함수를 어떻게 추가 할 수 있습니까? 필자는 노력하지만 난이 전혀 자바 스크립트에 자동으로 일이 아니다
class ={};
class.hey = function(values)
{
document.getElementById(values.id).innerHTML = values.Val ;
return class;
}
class.hey({
id:"objetive",//the element does not exist
Val: "hello world",//this wil work and will display that value in the span tag
success:function(msg)
{
alert("ok!")
},
error:function(msg){
alert("wrong");
}
})
<span id="target"></span>//here will appear the value passed before
jQuery없이 jQuery를 할 수 있습니까? – adeneo
jajaja 너는 그것을 얻었다 – Misters