[英]can someone explain this bit of code?
can someone explain this bit of code? 谁能解释一下这段代码?
<script type="text/javascript"><!--
$('#button-confirm').bind('click', function() {
$.ajax({
type: 'get',
url: 'index.php?route=hybrid_directory/confirm',
success: function() {
location = '<?php echo $continue; ?>';
}
});
});
function formSubmit()
{
document.getElementById("freecontactform").submit();
}
//--></script>
button-confirm, when clicks submits the information from a php contact form. 按钮确认,当点击从php联系表单提交信息时。 how is url and function - location used? 如何使用网址和功能 - 使用位置?
This is an ajax call, triggered when an element with an id of "button-confirm" is clicked. 这是一个ajax调用,当单击id为“button-confirm”的元素时触发。
When the ajax call is complete, the url relocates to whatever the PHP script loading this page defined as $continue
当ajax调用完成后,url将重定位到加载此页面定义为$continue
的PHP脚本
Here's the docs to the jquery ajax method: http://api.jquery.com/jQuery.ajax/ 这是jquery ajax方法的文档: http : //api.jquery.com/jQuery.ajax/
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.