script-tag

What is the difference between a script tag with and without a runat=server attribute

纵饮孤独 提交于 2019-12-10 18:56:29
问题 What is the difference between <script runat="server"> and <script> ? 回答1: When you add runat="server" attribute the tag will become available in server side code like any other asp.net control. Then you will be able to manipulate/add c#/javascript code within the blocks directly. If you don't add the runat attribute you will be able to only have client side scripting. 回答2: The runat="server" tag tells the .NET compiler to execute the tag on the server. it can be added to any html tags which

Strip out referers from script src

半腔热情 提交于 2019-12-10 17:37:21
问题 I'm doing a remote script-src <script src="http://thirdparty.com/test.js"></script> I don't want to send my http referer headers to thirdparty.com. How do I do it? 回答1: You would have to proxy the request for the script through your own server. For example: <script src="stripreferrer.php?url=http%3A%2F%2Fthirdparty.com%2Ftest.js"></script> Then, your server-side code would make the HTTP request sans referrer code, and pass the response to the client. 回答2: The answers from 2013 are obsolete:

Do running script tags block other script tags from downloading?

≡放荡痞女 提交于 2019-12-07 07:53:11
问题 This is from the index.html in HTML5 Boilerplate, just before the </body> tag: <!-- JavaScript at the bottom for fast page loading: http://developer.yahoo.com/performance/rules.html#js_bottom --> <!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.7.2.min.js"><\/script>')</script> <!-- scripts

Use wildcard in src attribute of <script> tag?

倖福魔咒の 提交于 2019-12-06 21:28:38
问题 Ok, stupid question and I don't think it's possible but, I have this markup at the top of my .aspx page... <%--Third Party Libraries, Plugins, Extensions --%> <script src="Libraries/Raphael/Raphael.js" type="text/javascript"></script> <script src="AutoComplete/jquery.autocomplete.js" type="text/javascript"></script> <script src="Libraries/jQuery/1.4.2/jquery.js" type="text/javascript"></script> <script src="Libraries/jQuery/UI/1.8.4/jquery.ui.core.js" type="text/javascript"></script> <script

Do running script tags block other script tags from downloading?

橙三吉。 提交于 2019-12-05 16:52:16
This is from the index.html in HTML5 Boilerplate , just before the </body> tag: <!-- JavaScript at the bottom for fast page loading: http://developer.yahoo.com/performance/rules.html#js_bottom --> <!-- Grab Google CDN's jQuery, with a protocol relative URL; fall back to local if offline --> <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> <script>window.jQuery || document.write('<script src="js/vendor/jquery-1.7.2.min.js"><\/script>')</script> <!-- scripts concatenated and minified via build script --> <script src="js/plugins.js"></script> <script src="js/main

Recaptcha - Script tag injection failing sporadically

岁酱吖の 提交于 2019-12-05 08:56:11
I have a form which uses reCAPTCHA. For some reason, when a user submits this form with an incorrect recapture value, when the page is re-rendered, the recapture fails to render. What it looks like it happening is that recapture attempts to inject a "script" tag, and sporadically (and only in certain browsers, certain environments, and in certain scenarios), it is failing to add that "script" tag to the DOM. It happens like this: 1) There is some inline javascript embedded in the form that looks like this: https://www.google.com/recaptcha/api/challenge?k=<our public key> 2) That script

Use wildcard in src attribute of <script> tag?

拥有回忆 提交于 2019-12-05 02:45:49
Ok, stupid question and I don't think it's possible but, I have this markup at the top of my .aspx page... <%--Third Party Libraries, Plugins, Extensions --%> <script src="Libraries/Raphael/Raphael.js" type="text/javascript"></script> <script src="AutoComplete/jquery.autocomplete.js" type="text/javascript"></script> <script src="Libraries/jQuery/1.4.2/jquery.js" type="text/javascript"></script> <script src="Libraries/jQuery/UI/1.8.4/jquery.ui.core.js" type="text/javascript"></script> <script src="Libraries/jQuery/UI/1.8.4/jquery.ui.widget.js" type="text/javascript"></script> <script src=

DOMDocument remove script tags from HTML source

余生颓废 提交于 2019-12-05 00:20:51
I used @Alex's approach here to remove script tags from a HTML document using the built in DOMDocument. The problem is if I have a script tag with Javascript content and then another script tag that links to an external Javascript source file, not all script tags are removed from the HTML. $result = ' <!doctype html> <html> <head> <meta charset="utf-8"> <title> hey </title> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script> alert("hello"); </script> </head> <body>hey</body> </html> '; $dom = new DOMDocument(); if($dom-

What's the point of Content-Script-Type and Content-Style-Type

ⅰ亾dé卋堺 提交于 2019-12-04 23:30:52
问题 Consider these two lines: <meta http-equiv="Content-Script-Type" content="text/javascript" /> <meta http-equiv="Content-Style-Type" content="text/css" /> From the W3's documentation on Scripting, in the section The default scripting language: Authors should specify the default scripting language for all scripts in a document by including the following META declaration in the HEAD Yet it continues in Local declaration of a scripting language to say: The type attribute must be specified for

How can I use runat=“server” on a script tag in asp.Net

别等时光非礼了梦想. 提交于 2019-12-03 23:40:59
I don't necessarily need to run it at server, however, I would like to use the ~/js/somefile.js syntax. Previously, I had just set everything with Absolute paths and set my project to be at the root level. SO, I'd just declare all my stylesheets, background images and javascript files something like /css/somefile.css However, for this project, it doesn't run as root. I can't put runat="server" on a script tag. I can put it on a link tag, though. This must be a common problem with a few simple answers. David What I've always done is use a normal script tag and put the src in <% %> tags, as