新的jQuery。需要簡單語法的幫助。不確定調用多個函數的正確方式。我只需要簡單的語法幫助
<script>
$(document).ready(function() {
jQuery.validator.addMethod("phoneUS", function (phone_number, element) {
phone_number = phone_number.replace(/\s+/g, "");
return this.optional(element) || phone_number.length > 9 && phone_number.match(/^(1-?)?(\([2-9]\d{2}\)|[2-9]\d{2})-?[2-9]\d{2}-?\d{4}$/);
}, "Please specify a valid phone number");
$("#networx_affiliate").validate({
rules: {
service_name: "required"
}
}).ajaxForm({
url: '**********',
target: '#output',
type: 'post',
dataType: 'xml',
success: function processXml(responseXML) {
// 'responseXML' is the XML document returned by the server; we use
// jQuery to extract the content of the message node from the XML doc
$(xml).find("affiliateresponse").each(function() {
$("#output").append($(this).find("successCode") + "<br />");
$("#output").append($(this).find("errormessage") + "<br />");
});
}
});
});
</script>
我得到了驗證表單插件和ajax表單插件。請給他們打電話的正確方法是什麼?導致我現在有他們的方式阿賈克斯似乎並沒有工作。
謝謝
完成謝謝@Brock亞當斯 – mojotaker