当我在jquery库中加载时,我的原型代码不再起作用,即使 jquery 是要加载的第一个库。
页面的 html 看起来有点像这样:
<head>
...
<script type="text/javascript" src="/js/jquery.min.js"></script>
<script type="text/javascript" src="/js/effects.js"></script>
<script type="text/javascript" src="/js/prototip.js"></script>
<script type="text/javascript" src="/js/dragdrop.js"></script>
<script type="text/javascript" src="/js/default.js"></script>
<script type="text/javascript" src="/js/limitfocus.js"></script>
...
</head>
<body>
<input type="radio" name="useOtherAddress" id="useOtherAddress_y" value="y" onclick="selectAddress()">
<input type="radio" name="useOtherAddress" id="useOtherAddress_n" value="y" onclick="selectAddress()">
<div id="myAddress" style="display: none;">
...
</div>
<script type="text/javascript">
// the piece of protptype code no longer working
function selectAddress () {
var t = $('myAddress');
if ($('useOtherAddress_n').checked) {
Effect.Appear(t);
return;
}
t.hide();
}
</script>
有人有什么想法吗?这一页:
http://docs.jquery.com/Using_jQuery_with_Other_Libraries
建议首先加载 jquery 应该使一切方便-花花公子。但它不是:[