使用查询sql Jquery重新加载弹出窗口 [英] Reload popup with query sql Jquery

查看:117
本文介绍了使用查询sql Jquery重新加载弹出窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要动物网站的帮助

我需要启动一个弹出窗口(可以)

I need launch a popup (it's ok)

<input type='submit' rel="0" data-target="_blank"  class='refresha' id='refresha' value=' Lancer protec animaux' /> 

和Jquery

$(document).on('click', '.refresha', function(e) {
    var url = //How take url in a php file with a query ?
    var windowName = $( this ).data( 'id' );
    var windowSize = windowSizeArray[$(this).attr("rel")];
    windowvote = window.open(url, windowName, windowSize);
    windowvote.moveTo(600, 0);  
    var timer = setInterval(function() {   
        if(windowvote.closed) {                             
            $("#protecAnimaux").val('fenêtre fermée avant 10 secondes...');
            clearInterval(timer);  
        }else{
            // After timer, i need popup is reload with a new link obtain by the php file with the query sql.
            $.ajax({
                type: "POST",
                url: "link.php",
                data: url,
                success: function(){    
                    windowvote.reload();   
                }
            });

            $("#protecAnimaux").val('fiche animaux test!!');
            clearInterval(timer);
        }  
    }, 3000); 
}); 

在计时器之后,我需要弹出窗口重新加载一个新链接,该链接由带有查询sql的php文件获得.

After timer, i need popup is reload with a new link obtain by the php file with the query sql.

非常感谢您的帮助.

推荐答案

我可以回答隐藏在代码中的问题:

I can answer on question which is hidden in the code:

var url = //How take url in a php file with a query ?

您可以在输入标签中存储网址:

You can store url in you input tag:

<input type='submit' data-url=<?=$urlFromPhp?> rel="0" data-target="_blank"  class='refresha' id='refresha' value=' Lancer protec animaux'/>

您可以通过jQuery这样获得它:

And you can get it in jQuery this way:

$(document).on('click', '.refresha', function(e) {
  var url = $(this).data('url');
  ...

这篇关于使用查询sql Jquery重新加载弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆