使用asp.net查找javascript标签 [英] find javascript tag using asp.net

查看:100
本文介绍了使用asp.net查找javascript标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨!

我的html页面中有5个不同的javascript标签,例如:

Hi!

I have 5 different javascript tags in my html page like:

<script type="text/javascript" src="js/boxOver.js"></script>
<script type="text/javascript" src="js/boxiner.js"></script>
.
.
.<script type="text/javascript" src="js/over.js"></script>


我想选择一个特定标签并使用Asp.Net删除它.有人可以告诉我该怎么做吗?

在此先感谢


I want to select a particular tag and delete it using Asp.Net. Can somebody tells me how to do it?

thanks in advance

推荐答案

我要做的是从aspx页面中删除脚本标签,然后可以使用一些逻辑,如果确定要加载它您可以执行的C#

What I would do is remove the script tag from the aspx page and then you can use some logic and if you do decide you want it loaded in the C# you can do

Page.ClientScript.RegisterClientScriptInclude("jQuery",ResolveClientUrl("Common/Scripts/jquery.min.js"));



客户端尝试删除它的问题是,如果其中有任何代码可以在准备就绪的文档上运行,那么到您删除它时,它已经已经运行.

但是,您可以尝试使用document.scripts进行尝试,并尝试使用remove()jQuery命令.我仍然不建议这样做.我建议尝试以其他方式获得最终结果.



The problem with trying to remove it client side is that if there is any code in it that runs on document ready then it will have already run by the time you go to remove it.

However, you can try getting to it using document.scripts and try the remove() jQuery command. I still do not recommend this. I recommend trying to get to your end result a different way.


这篇关于使用asp.net查找javascript标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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