php js ajax get 没反应,求助. 将 <script src="jquery-1.5.1.min.js"></script> <script src="url.js"></script>放在head里面 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 用firebug查看下是否错误提示信息... cc()未执行,你是因为url.js都没调用,将jquery类库和url.js 放在head里面,这样调用cc(),才会生效。 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 的 怎么匹配下面的连接的ID数字 <?= 是什么意思? 和<?php有什么区别吗 求高手写个php语句 javascript动态生成input,然后提交表单,但是处理页面收不到动态生成的input的值! 求字符(.)的正确用法 关于mysql字符集问题 怎样用php实现手机网站的产品的比较功能 wap上的图书网站 为何这段插入留言代码不成功 php网站如何找到html.tpl画面代码地址? 求一个正则表达式,使用preg_match 织梦系统后台问题
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 的