3 May, 2013
0 Comments
1 category
Microsoft’s MSApp.execUnsafeLocalFunction can be used to dynamically add potentially unsafe code to the DOM. If you want to use this function in a cross platform HTML 5 app, you might want to wrap the function like:
if ("undefined" === typeof Utilities) { Utilities = {}; } Utilities.executeUnsafe = function (func) { if ("undefined" !== typeof MSApp) { MSApp.execUnsafeLocalFunction(function () { func(); }); } else { func(); } };
Now you can call a potentially unsafe function, like:
Utilities.executeUnsafe(App.myFunction);
Where App.myFunction should be replaced by your function.
Category: Uncategorized