随手贴


import javax.script.ScriptEngineManager;

public class Test {  
	
	public static void main(String[] args) throws Exception {
		String str = "true && false";
		Object eval = new ScriptEngineManager().getEngineByName("js").eval(str);
		System.out.println(eval);
	  
	}  }

	var jsonStr='{"name":"CJ","age":18}';
        var jsons1 = eval('(' + jsonStr + ')');
	var jsons2 =(new Function("","return "+jsonStr))();


上一篇:基于Angular创建后台数据模拟(译)


下一篇:SQL 批量修改订单号