我有功能验证我的表单和表单提交后
else
{
$('.submit-button').val('Wait please...');
$('.submit-button').attr('disabled', 'disabled');
return true;
}
PHP 重定向到主页
function wpcallback_get_target() {
global $wpcallback_plugin_option;
if($value = $callback_plugin_option['target'])
return get_permalink($value);
return get_site_url();
}
PHP 获取站点 url 那么我如何才能打开感谢模式窗口?我试过 .modal 但找不到合适的地方。
$('#myModal').modal('show');
放置$('#myModal').modal('show');
在您查看文件的底部,或者您可以在 head 标签中添加以下代码
$(document).ready(function(){
$('#myModal').modal('show');
});
为了防止每次页面加载时建模,请更新您的 PHP 文件:
function wpcallback_get_target() {
global $wpcallback_plugin_option;
if($value = $callback_plugin_option['target'])
return get_permalink($value);
$url = get_site_url();
return $url."?response=true";
}
在视图文件中:
<?php if(isset($_GET['response']) && $_GET['response'] == 'true'){ ?>
$(document).ready(function(){
$('#myModal').modal('show');
});
<?php } ?>
使用Javascript代码:
$(document).ready(function(){
var myURL = window.location;
var res = myURL.search("response=true");
if(res > 0){
$('#myModal').modal('show');
}
});
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句