Aswin Kumar K P
Aswin Kumar K P

Reputation: 1102

eval() not working in WinJS. Disable WinJS.strictProcessing(); in Windows 8 store app

I have a js code that I have used in my website. I have used a eval() to keep the code secret. But now I need to use the same code in my winJS app. But I found that the eval() function does not work in WIndows store app due to WinJS.strictProcessing() . By default it is turned on. So I need to turn it off . How could I do that. Thanks in Advance.

Upvotes: 2

Views: 137

Answers (2)

Use MSApp.execUnsafeLocalFunction, https://msdn.microsoft.com/en-us/library/windows/apps/hh767331.aspx, which is part of the app host and not part of WinJS. You can do an eval within the callback you give to it. It's intentionally done this way to make you really, really conscious of how you're using functions like eval and the attendant security risks.

Upvotes: 1

Blindman67
Blindman67

Reputation: 54026

'WinJS.strictProcessing();' is a depreciated call. Strict processing is now always on. Sorry but eval has no place in the WinJS namespace.

Upvotes: 0

Related Questions