<script src="jquery-1.5.1.min.js"></script>
    <script src="url.js"></script>放在head里面

解决方案 »

  1.   

    用firebug查看下是否错误提示信息...
      

  2.   

    cc()未执行,你是因为url.js都没调用,将jquery类库和url.js 放在head里面,这样调用cc(),才会生效。
      

  3.   

    1、js文件放在哪里都无关紧要,当然最好是放在 head 标签内
    2、既然你已经加载了 jquery,那么就应该使用 jquery 提供的 ajax 功能,而不是自己再写一套
    function cc(){
    localurl = document.location;
      $.get('http://localhost/test.php', {curl:$(location).attr('href')}); 
    }
    或$(function() {
      $('[vdata="go"]').click(function() {
        $.get('http://localhost/test.php', {curl:$(location).attr('href')}, function(d){ alert(d)}); 
      });    
    });
            <a href="http://www.google.com/" vdata="go">This is ads1</a><br/>
            <a href="http://www.bing.com" vdata="go">This is ads2</a><br/>
            <a href="http://www.baidu.com" vdata="go">This is ads3</a>3、至于你的代码中的问题,多半是
    xmlHttp=new XMLHttpRequest();
    引起的。不是每个浏览器都有 XMLHttpRequest 的