Load and execute javascript code SYNCHRONOUSLY

If you use this: function loadScriptSync (src) { var s = document.createElement(‘script’); s.src = src; s.type = “text/javascript”; s.async = false; // <– this is important document.getElementsByTagName(‘head’)[0].appendChild(s); } You can do what you want (although divided up in an additional script file) test.html (code inside a script tag): loadScriptSync(“script.js”); loadScriptSync(“sayhi.js”); // you have to put … Read more

Can .NET load and parse a properties file equivalent to Java Properties class?

No there is no built-in support for this. You have to make your own “INIFileReader”. Maybe something like this? var data = new Dictionary<string, string>(); foreach (var row in File.ReadAllLines(PATH_TO_FILE)) data.Add(row.Split(‘=’)[0], string.Join(“=”,row.Split(‘=’).Skip(1).ToArray())); Console.WriteLine(data[“ServerName”]); Edit: Updated to reflect Paul’s comment.

Load external JS from bookmarklet?

2015 Update Content security policy will prevent this from working in many sites now. For example, the code below won’t work on Facebook. 2008 answer Use a bookmarklet that creates a script tag which includes your external JS. As a sample: javascript:(function(){document.body.appendChild(document.createElement(‘script’)).src=”https://stackoverflow.com/questions/106425/** your external file URL here **”;})();