I'm writing some JavaScript code to parse user-entered functions (for spreadsheet-like functionality). Having parsed the formula I could convert it into JavaScript and run eval() on it to yield the result.  However, I've always shied away f...
Are these two functions doing the same thing behind the scenes? (in single statement functions)  var evaluate = function(string) {     return eval('(' + string + ')'); }  var func = function(string) {     return (new Function( '...
I have a javascript file that reads another file which may contain javascript fragments that need to be eval()-ed. The script fragments are supposed to conform to a strict subset of javascript that limits what they can do and which variables they c...
Has anyone implemented Mozilla's Object.toSource() method for Internet Explorer and other non-Gecko browsers?  I'm looking for a lightweight way to serialize simple objects into strings....
An ajax request returns me a standard JSON array filled with my user's inputs. The input has been sanitized, and using the eval() function, I can easily create my javascript object and update my page...  So here's the problem. No matter how...
I would like to have the ability to let users submit arbitrary JavaScript code, which is then sent to a Node.JS server and safely executed before the output is sent back to multiple clients (as JSON). The eval function comes to mind, but I know this...
I have a little bit of code that looks just like this:  function StrippedExample(i1, i2, i3, i4, i5, i6, i7, i8) {     this.i = [];     for (var i=1,j=0 ;i<9;i++) {         var k = eval("i"+i);         if (k > 0) {             this.i[j+...
I understand about how eval() works in non-strict contexts, however the case of using eval() in strict mode has completely befuddled me.  When eval() is called directly in the global scope, variables are kept inside the new eval() scope:  'use st...
I have a project, in which some JavaScript var is evaluated. Because the string needs to be escaped (single quotes only), I have written the exact same code in a test function. I have the following bit of pretty simple JavaScript code:  function test...
I am interested in building a text editor in a CMS backend that allows users to write Javascript into a textarea and test it while editing.  The closest I can think of is something like.  document.head.appendChild(document.createElement('script&#...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.