我需要帮助动物网站
我需要启动一个弹出窗口(没关系)
<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);
});
在计时器之后,我需要弹出重新加载一个新的链接,由php文件获取查询sql。
非常感谢您的帮助。
答案 0 :(得分:0)
我可以回答代码中隐藏的问题:
var url = //How take url in a php file with a query ?
您可以将url存储在输入标记中:
<input type='submit' data-url=<?=$urlFromPhp?> rel="0" data-target="_blank" class='refresha' id='refresha' value=' Lancer protec animaux'/>
你可以通过这种方式获得它:
$(document).on('click', '.refresha', function(e) {
var url = $(this).data('url');
...