html - ASP.Net: Fail to put <script> inside <head> -


i put <script> inside <head> tag in master page. rendered result in browser, put @ bottom of <body>. rebuilding application doesn't work, neither cleaning browser cache. idea? thanks.

<head><script type="text/javascript">alert();</script></head> 

you can use appendchild add script head. this:

document.getelementsbytagname('head')[0].appendchild(script); 

edit:

as mentioned in comments ,

here take @ this article:

it provides nice clean way add script head element using extension method.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -