路由Javascript问题 [英] Routing Javascript problem

查看:119
本文介绍了路由Javascript问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在我的asp.net应用程序中实现URL路由时,我的JavaScript无效.....

路径有问题...

来源我在页面的头部添加的路径被浏览器识别....

如果有人知道如何解决这个问题,请帮助我........



以下是一些示例代码: -



< pre lang = Javascript>< pre lang =Javascript>< pre lang =Javascript> 

 < ;   head     id  < span class =code-keyword> =  Head1 >  


< script 类型 = text / javascript src = http://ajax.googleapis.com/ajax/libs/jquery/1.4.2 /jquery.min.js\"> < / script >

< < span class =code-leadattribute> script src = ../ jscripts / jquery-1.4.1.js 类型 = text / javascript < span class =code-keyword>> < / script >
< script < span class =code-attribute> src = ../../ jscripts / jquery.helper.js type = text / javascript > < / script >
< script type = text / javascript >
$(document).ready(function(){
$(a#show-panel ).click(function(){
$(#lightbox,#LightBox-Hide)。fadeIn(300);
})
$(a#close-panel)。click(function(){
$(#lightbox,#LightBox-Hide)。fadeOut(300);
})
})
< / script >
< / head < span class =code-keyword>>







查看页面时在浏览器中,与这些jquery文件相关的javascript功能无法正常工作,即使CDN无法正常工作。

调试时我发现这些文件并不意味着存在路径问题......
没有路由的
工作正常。

解决方案

(document).ready(function(){


( a#show-panel)。click(function(){


(#lightbox,#LightBox-Hide)。fadeIn(300);
})

My JavaScript is not working when i implement URL Routing in my asp.net application.....
There is problem of path ...
the source path i am adding in the head section of the page is recognized by the Browser....
If anybody know how to solve this problem please help me........

Here is some sample code :-

<pre lang="Javascript"><pre lang="Javascript"><pre lang="Javascript">

<head id="Head1">
    
    
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

    <script src="../jscripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../jscripts/jquery.helper.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $("a#show-panel").click(function () {
                $("#lightbox, #LightBox-Hide").fadeIn(300);
            })
            $("a#close-panel").click(function () {
                $("#lightbox, #LightBox-Hide").fadeOut(300);
            })
        })
    </script>
</head>




when view the page in the browser the javascript functionality asscoiated with these jquery files is not working even CDN is not working.
when debug i found that these files are not means there is some path problem...
without routing this is working fine.

解决方案

(document).ready(function () {


("a#show-panel").click(function () {


("#lightbox, #LightBox-Hide").fadeIn(300); })


这篇关于路由Javascript问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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