jquery在纯客户端引用没有问题,在服务端引用就出错了。引用代码很简单
<script type="text/<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=javascript">javascript</SPAN>" src="/jquery-1.4.1.js"></script>在firebug里面调试 ,调试显示的jquery代码和我实际上引用的jquery文件不一样。 好像jquery文件里面被打乱了。 举个例子。这是我在firebug里面调试出来的错误行 在firebug里面看到的是这样。
function liveConvert( type, selector ) { 02 return "live." + (type ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&"); 03 } 04 05 jQuery.each( ("blur focus focusin focusou/*! 06 * jQuery JavaScript Library v1.4.1 07 * http://jquery.com/ 08 * 09 * Copyright 2010, John Resig 10 * Dual licensed under the MIT or GPL Version 2 licenses. 11 * http://jquery.org/license 12 * 13 * Includes Sizzle.js 14 * http://sizzlejs.com/ 15 * Copyright 2010, The Dojo Foundation 16 * Released under the MIT, BSD, and GPL Licenses. 17 * 18 * Date: Mon Jan 25 19:43:33 2010 -0500 19 */ 这个注释在jquery文件里面应该出现在头部,可是它出现在不合适的地方。实际上我的jquery文件里面找不到这一行。当然不止这一处。jquery文件引用没有问题,我把文件全部清空然后alert(1) 可以弹出结果。ie ff 缓存我已全部清空,apache2我也重装过,现在本人已经无计可施。泪奔,希望大家帮忙。。
<script type="text/<SPAN class=t_tag onclick=tagshow(event) href="tag.php?name=javascript">javascript</SPAN>" src="/jquery-1.4.1.js"></script>在firebug里面调试 ,调试显示的jquery代码和我实际上引用的jquery文件不一样。 好像jquery文件里面被打乱了。 举个例子。这是我在firebug里面调试出来的错误行 在firebug里面看到的是这样。
function liveConvert( type, selector ) { 02 return "live." + (type ? type + "." : "") + selector.replace(/\./g, "`").replace(/ /g, "&"); 03 } 04 05 jQuery.each( ("blur focus focusin focusou/*! 06 * jQuery JavaScript Library v1.4.1 07 * http://jquery.com/ 08 * 09 * Copyright 2010, John Resig 10 * Dual licensed under the MIT or GPL Version 2 licenses. 11 * http://jquery.org/license 12 * 13 * Includes Sizzle.js 14 * http://sizzlejs.com/ 15 * Copyright 2010, The Dojo Foundation 16 * Released under the MIT, BSD, and GPL Licenses. 17 * 18 * Date: Mon Jan 25 19:43:33 2010 -0500 19 */ 这个注释在jquery文件里面应该出现在头部,可是它出现在不合适的地方。实际上我的jquery文件里面找不到这一行。当然不止这一处。jquery文件引用没有问题,我把文件全部清空然后alert(1) 可以弹出结果。ie ff 缓存我已全部清空,apache2我也重装过,现在本人已经无计可施。泪奔,希望大家帮忙。。
不明白楼主为啥要在里面加span标签 问题应该就在那
所有jquery的代码放在这看看...因为也有可能dom没加载好.
});
楼主啊..泪奔也要把问题讲清楚啊..
确认 jquery-1.4.1.js 所在目录有执行权限
不止是jquery,prototype.js的引用也会出现类似的情况,在第2000行左右的时候莫名其妙的文件会重复到开头。。(只是在调试工具里面可以看到,如果我打开该文件的话看不到)好像是中了病毒 在解析的时候被篡改了一样。
Element.Methods.getStyle = function(element, style) {
element = $(element);
style = (style == 'float' || style == 'cssFloat') ? 'styleFloat' : style.camelize();
var value = element.style[style];
if (!value && element.currentStyle) value = element.currentStyle[style]; if (style == 'opacity') {
if (value = (element.getStyle('filter') || '').match(/alpha\(opacity=(.*)\)/))
if (value[1]) return parseFloat(va/* Prototype JavaScript framework, version 1.6.0.3
* (c) 2005-2008 Sam Stephenson
*
* Prototype is freely distributable under the terms of an MIT-style license.
* For details, see the Prototype web site: http://www.prototypejs.org/
*
*--------------------------------------------------------------------------*/var Prototype = {
Version: '1.6.0.3',这是我在调试器中看到的代码
你应该直接下载该文件来比较
客户端引用和服务端引用分别指什么?
还由,如果我在服务端把jquery直接写到页面上也不会出错。
-------------------------------------
这里的在服务端写上是叫服务端引用吗?
楼不好意思我没有写清楚比如我把该目录直接拖到桌面,
然后点击里面的index.html 是可以引用到jquery的,浏览器里面的目录是c:\\桌面 \\index.html如果我以http的方式访问就会出问题。
http://127.0.0.1/index.html
<script type="text/javascript" src="/jquery-1.4.1.js">jquery code here</script>
</head>
<body>
</body>类似这样。只要一include就出错
和我引用的jquery和prototype文件不一样 下载出来的文件就是firebug里面调试的,被打乱了
至于有什么不一样,看我9楼的回复就知道了。
我一开始以为是中了病毒,但是今天早上查了毒也没问题不行只有逼得我重做系统了。
楼主你把include换成require试试呢...