在每个页面上添加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.

查看全部
weixin_33729196
weixin_33729196
2014/03/28 09:39
  • php
  • ajax
  • javascript
  • jquery
  • 点赞
  • 收藏
  • 回答
    私信

2个回复