Do common JavaScript implementations use string interning?

Yes. In general any literal string, identifier, or other constant string in JS source is interned. However implementation details (exactly what is interned for instance) varies, as well as when the interning occurs. Note that a string value is not the same as a String Object though, String Objects are not interned because that would … Read more

Add new Microsoft Edge to web browser control?

UPDATE Jan 2021: WebView2 has been released. This enables integration of the Chromium based Edge as a web control. It’s a lot more complicated to use, unfortunately, but a lot more powerful. Works with WinForms or WPF or C++ apps. https://learn.microsoft.com/en-us/microsoft-edge/webview2/ UPDATE May 2018: FINALLY Microsoft has made it easy. https://blogs.windows.com/msedgedev/2018/05/09/modern-webview-winforms-wpf-apps/ For now, the new … Read more

How do I print an IFrame from javascript in Safari/Chrome

Here is my complete, cross browser solution: In the iframe page: function printPage() { print(); } In the main page function printIframe(id) { var iframe = document.frames ? document.frames[id] : document.getElementById(id); var ifWin = iframe.contentWindow || iframe; iframe.focus(); ifWin.printPage(); return false; } Update: Many people seem to be having problems with this in versions of … Read more

How to use CSS (and JavaScript?) to create a blurred, “frosted” background?

Thanks for the inspiration… It led me to this canvas plugin which does the trick New and Improved: -webkit- and Firefox Working Example, now re-sizable/fluid. JS $(document).ready(function () { frost = function () { var w = $(‘#main-view’).width(); html2canvas(document.body, { onrendered: function (canvas) { document.body.appendChild(canvas); $(‘canvas’).wrap(‘<div id=”contain” />’); }, width: w, height: 30 }); $(‘canvas, … Read more

iPad/iPhone browser crashing when loading images in Javascript

Update: I think there’s an even easier way to do this, depending on your application. Instead of having multiple images, if you simply have one <img> element or Image object (or maybe two, like a ‘this’ image and a ‘next’ image if you need animations or transitions) and simply update the .src, .width, .height and … Read more

What is -webkit-focus-ring-color?

-webkit-focus-ring-color is defined in the WebKit codebase as focusRingColor in each RenderTheme class. That work was performed in June 2009 as part of this changeset by Jeremy Moskovich. For instance, the default Mac theme (used by Safari) defines the colour in RenderThemeMac.mm (in a roundabout way) as: [NSColor keyboardFocusIndicatorColor] (Apple’s very light documentation of that … Read more

View AJAX response content in Chrome developer tools?

If you are on a dev channel of Google Chrome: http://www.chromium.org/getting-involved/dev-channel …you should be able to right-click in the Developer Tools console, and click “Enable XMLHttpRequest logging”. Once it is enabled, you will see the XHR requests in the console, and will be able to click on them to take you to the resources panel, … Read more

Extract the current DOM and print it as a string, with styles intact

I think this could be a solution (it took me nearly a whole day!). It returns a string representing the DOM of any element, with all external styles included in the “style” attributes except default values, and does not permanently modify that element. For example: console.log(document.body.serializeWithStyles()); You can load this code in Web Inspector command … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)