简体   繁体   中英

disable script running from c#/asp.net

Hello I want to disable this script for twitter widget to be displayed on some pages. How can I access the script from the backend and change the url on runtime?

<script id="twitter" src="http://widgets.twimg.com/j/2/widget.js">

Thanks in advance

That's not really possible.. modern browsers will leave the code in memory even if you remove the script tag from the DOM itself.

The only way around I can think of is to "overwrite" the object/functions: in the bottom of the page have your own script defining exactly the same functions and objects like that script, except they will be null/empty so the final result is like removing the script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM