How to add a textnode to script and allow a fallback.

Standard

From: http://bytes.com/topic/javascript/answers/743778-please-help-me-updating-dom-element-javascript-contents

How to add code with createTextNode using “appendChild” to a “<script>”.

Fact is, as of right now- 2010/05/17 with the Internet Explorer 8 and below you cannot use the “document.createTextNode()” and append it to a “document.createElement(‘script’)”.

So the code below will allow you to by default use the normal method and fallback to IE’s method.

For IE you must use the .TEXT.

Eg: document.createElement(‘script’).text=”TEST CODE”;

document.newScript= function(s){
var el= document.createElement(‘script’);
el.type= ‘text/javascript’;
try{
el.appendChild(document.createTextNode(s));
}
catch(er){
el.text= s;
}
return document.getElementsByTagName(‘head’)[0].appendChild(el);
}

505 total views, 2 views today

Opera 10.5 Beta Adds Private Browsing and Excellent Windows 7 Integration [Downloads]

Standard

Windows only: The latest beta version of the Opera browser adds total Windows 7 integration, with Jump Lists, Aero Peek, and a beautiful Aero Glass interface—and we’ve got a quick tour of all the new features.

The first thing you’ll notice after installing the 10.5 beta is that the interface has been completely re-done with Aero Glass for Windows 7 or Vista users. The menu bar has been rolled up into a single button similar to the way Office 2007 works, with easy access to all common functions all from one place.

Windows 7 users can now hover their mouse over the taskbar button and see previews of each of the open tabs, and moving your mouse over a specific tab will enable the Aero Peek effect and show the Opera window with the contents of that particular tab—just the way Internet Explorer 8 does. You can even middle-click on the thumbnail preview to close a tab.




The Jump List menu shows the items from your Speed Dial, lets you open a new tab, or start a new private browsing session in a separate tab. Once you’ve opened a new private tab—which you can also do by right-clicking on the new tab button on the right of the tab bar—the icon in the tab will change to indicate that you are in a private browsing session.

You can choose to open a separate window for private browsing, but being able to include that private tab without requiring a new window is a nice feature that you can’t currently do in any of the other mainstream browsers.

Opera 10.5 beta is a free download for Windows only; Unix and Mac builds will be available later this week.







676 total views, 1 views today