为什么JQuery不在具有Master页面的页面上工作? [英] why JQuery is not working on pages which has Master page ?

查看:84
本文介绍了为什么JQuery不在具有Master页面的页面上工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我使用了母版页。并且我使用jquery作为菜单项..



一个是smootmenu.js,一个是jquery版本1.2.6



在同一主页上我也申请了css。





~ / js / 1.2.6.js

~ / js / smoothmenu.js



现在当我来到我的主页面时..



我有子文件夹



主文件夹系统 - >

有子文件夹名为user并且在此页面下我有我的.aspx页面



和我的js文件夹在系统内



现在问题出现在我使用的时候这个文件夹系统我的jquery正在每一页上工作。'





但是现在当我在系统内创建一个名为Home的文件夹时当我将.aspx页面放在这个文件夹中时,jquery现在不能用于菜​​单..





i改变我所有可能的东西主页



给出硬编码的rooths,

。 ./../js/djhf.js



..也用过其他可能的东西..



< script src ='<%= Page.ResolveUrl(〜/ jquery-1.2.6.min.js)'type =text / javascript>< / script>



和许多其他建议一样,但是没有工作..如果我在我的系统文件夹中再创建一个文件夹,jquery就不会为那条路径而烦恼...如果我把那些页面保留回来系统文件夹..现在jquery工作..我想基于我的应用程序文件夹..但这是问题

Hi,
I used master page . and on that i used jquery for menu items ..

one is smootmenu.js and one is jquery version 1.2.6

on the same master page i also applied css .


~/js/1.2.6.js
~/js/smoothmenu.js

now when i come to my main page ..

I have subfolders

main folder System ->
there is subfolder named user and under this page i have my .aspx pages

and my js folder is inside System

now the problem is when i use this folder system my jquery is working on every page .'


but now when i create one more folder inside system named "Home" and when i keep my .aspx pages inside this folder the jquery wont work for menu now ..


i change all possible things on my master pages

giving hardcoded rooths,
../../js/djhf.js

.. also used other possible things ..

<script src='<%= Page.ResolveUrl("~/jquery-1.2.6.min.js")' type="text/javascript"></script>

and many other suggestion same like above but none is working .. if i create one more folder inside my system folder the jquery is not woirking for that path .. if i keep those pages back to system folder .. now jquery working .. i want to make my application folder based .. but this is the problem

推荐答案

你只需要注册Jquery文件到母版页并从所有其他页面中删除所有jquery文件。你的问题将得到解决。
U need to register the Jquery files only on to the master pages and remove all jquery files from all other pages. Your problem will be solved.


这篇关于为什么JQuery不在具有Master页面的页面上工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆