<SCRIPT type="text/javascript">
// 判断行业,地区等选择器中的数据是否在其设定数组内
function in_array(needle, haystack) {
if(typeof needle == 'string' || typeof needle == 'number') {
for(var i in haystack) {
if(haystack[i] == needle) {
return true;
}
}
}
return false;
}
</SCRIPT>
<!-- 文本框内输入字符的提示 -->
<script type="text/javascript">
var $j=jQuery.noConflict();
$j(function() {
$j('.limited').inputlimitor();
});
</script>
<!-- 日期控件,判断浏览器 -->
<script type="text/javascript"> var ie =navigator.appName=="Microsoft Internet Explorer"?true:false;
function $(objID){
return document.getElementById(objID);
}
</script>以上代码我方在 同一个页面内,总是会互相冲突,只有去掉其中一个才行,有高手看看是什么端倪吗?
// 判断行业,地区等选择器中的数据是否在其设定数组内
function in_array(needle, haystack) {
if(typeof needle == 'string' || typeof needle == 'number') {
for(var i in haystack) {
if(haystack[i] == needle) {
return true;
}
}
}
return false;
}
</SCRIPT>
<!-- 文本框内输入字符的提示 -->
<script type="text/javascript">
var $j=jQuery.noConflict();
$j(function() {
$j('.limited').inputlimitor();
});
</script>
<!-- 日期控件,判断浏览器 -->
<script type="text/javascript"> var ie =navigator.appName=="Microsoft Internet Explorer"?true:false;
function $(objID){
return document.getElementById(objID);
}
</script>以上代码我方在 同一个页面内,总是会互相冲突,只有去掉其中一个才行,有高手看看是什么端倪吗?
解决方案 »
- 下拉菜单打开后怎么关闭
- JS 如何判断 DOM 操作已经完成?
- 窗口之间的数据传递
- if($("#hui_tab1").find("#"+$val+"").is(":hidden")) {} 是什么意思?
- 可以动态添加,删除文本框.如果文本框没有添加内容,点击提交时,会弹出地文本框没有添加内容.
- 在一个jsp文件中jsp与JavaScript变量如何传递值
- -------登陆验证 成功后跳转到主页的问题??
- 对象传递问题,好急啊~~~~~~~~~~~online wait
- 一个鼠标事件的问题
- vue中数据在页面中的传递
- 这个选项卡要怎么制作啊??
- js在ie下能正常运行在火狐下为什么不能正常运行(附源码)
return document.getElementById(objID);
}
楼主都引用了Jquery的库。怎么自己还重定义一个$()方法?Jquery本来就封装有了这个方法的!
这不是多此一举麽?
没有问题,可以的;你看看你的js库是否导入,路径、顺序有没有错误
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>jQuery.noConflict.html</title>
<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="jquery.js"></script>
<!-- 文本框内输入字符的提示 -->
<script type="text/javascript">
var $j = jQuery.noConflict();
/*(function($) {
$(function() {
alert($("input").val());
//$('.limited').inputlimitor();
$("input").val('aaaaa');
});
})(jQuery);*/
$j(function() {
//$j('.limited').inputlimitor();
alert($j("input").val());
$j("input").val('aaaaa');
});
</script>
</head>
<body>
<SCRIPT type="text/javascript">
// 判断行业,地区等选择器中的数据是否在其设定数组内
function in_array(needle, haystack) {
if(typeof needle == 'string' || typeof needle == 'number') {
for(var i in haystack) {
if(haystack[i] == needle) {
return true;
}
}
}
return false;
}
</SCRIPT>
<input type="text" value="222"/>
<!-- 日期控件,判断浏览器 -->
<script type="text/javascript">
var ie =navigator.appName=="Microsoft Internet Explorer"?true:false;
function $(objID){
return document.getElementById(objID);
}
</script>
</body>
</html>
//使用jquery的相关代码
})(jQuery);