普通网友 2014-03-28 09:39
浏览 15

在每个页面上添加AJAX调用

So, I'm new to AJAX and I'm not sure how I will do this, but I have three different pages and I would like to add AJAX call to all of them and everything inside of those files.

I guess the page would start with something like:

$(document).ready(function(){
    setInterval(function(){
        $('').load('target.php');
    );
});

Not sure if that's a start or not? I'm quite a newbie, so if I forgot any information please tell me and I will try to edit the first post.

I would like to add the call when you click a menu.
EDIT:
<?php

echo "

      <li><a href='gestbookk.php'>Woodland</a></li>
         <li><a href='fileupload.php'>Hem</a></li>
         <li><a href='laddaupp.php'>Mountains</a></li>


";

?>

This one is included to all pages.So the AJAX call starts when clicking on one of the menu links.

  • 写回答

2条回答 默认 最新

  • weixin_33701251 2014-03-28 09:41
    关注
    <script>
       $(document).ready(function(){
         setInterval(function(){
         $('').load('target.php');
    
           }, 1000);
    
       });
     </script>
    
    评论

报告相同问题?

悬赏问题

  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序
  • ¥15 onvif+openssl,vs2022编译openssl64