当前位置: 首页 > news >正文

正规建筑工程网站上海网站建设排行

正规建筑工程网站,上海网站建设排行,做英剧网站的设计思路,了解网站建设之前测试了很多JS引擎#xff0c;都只支持es5语法#xff0c;不支持执行es6#xff0c;测试了下微软的V8反正能跑通#xff0c;应该是支持的。还得是微软呀。 如图#xff1a;安装相关包#xff1a; 这是参考的官方V8代码 using Microsoft.ClearScript.JavaScript; us…之前测试了很多JS引擎都只支持es5语法不支持执行es6测试了下微软的V8反正能跑通应该是支持的。还得是微软呀。 如图安装相关包 这是参考的官方V8代码 using Microsoft.ClearScript.JavaScript; using Microsoft.ClearScript.V8; using Microsoft.ClearScript; using System.Security.Cryptography;using (var engine new V8ScriptEngine()){// 指定JavaScript文件路径string filePath D:\test\CallJS\CallJS\test.js;// 读取JavaScript文件内容string javascriptCode File.ReadAllText(filePath);// expose a host typeengine.Execute(var window this;);engine.AddHostType(Console, typeof(Console));var type mp3;var mid 440613;var para $corpkuwop2p1typeconvert_url2sig0format{type}rid{mid};string str Console.WriteLine(encryptQuery(112233));string str1 Console.WriteLine(encryptQuery(para)).Replace(para, para);engine.Execute(javascriptCode C#有偿群927860652);engine.Execute(javascriptCode str1);engine.Execute(Console.WriteLine({0} is an interesting number., Math.PI));// expose a host objectengine.AddHostObject(random, new Random());engine.Execute(Console.WriteLine(random.NextDouble()));// expose entire assembliesengine.AddHostObject(lib, new HostTypeCollection(mscorlib, System.Core));engine.Execute(Console.WriteLine(lib.System.DateTime.Now));// create a host object from scriptengine.Execute(birthday new lib.System.DateTime(2007, 5, 22);Console.WriteLine(birthday.ToLongDateString()););// use a generic class from scriptengine.Execute(Dictionary lib.System.Collections.Generic.Dictionary;dict new Dictionary(lib.System.String, lib.System.Int32);dict.Add(foo, 123););// call a host method with an output parameterengine.AddHostObject(host, new HostFunctions());engine.Execute(intVar host.newVar(lib.System.Int32);found dict.TryGetValue(foo, intVar.out);Console.WriteLine({0} {1}, found, intVar););// create and populate a host arrayengine.Execute(numbers host.newArr(lib.System.Int32, 20);for (var i 0; i numbers.Length; i) { numbers[i] i; }Console.WriteLine(lib.System.String.Join(, , numbers)););// create a script delegateengine.Execute(Filter lib.System.Func(lib.System.Int32, lib.System.Boolean);oddFilter new Filter(function(value) {return (value 1) ? true : false;}););// use LINQ from scriptengine.Execute(oddNumbers numbers.Where(oddFilter);Console.WriteLine(lib.System.String.Join(, , oddNumbers)););// use a dynamic host objectengine.Execute(expando new lib.System.Dynamic.ExpandoObject();expando.foo 123;expando.bar qux;delete expando.foo;);// call a script functionengine.Execute(function print(x) { Console.WriteLine(x); });engine.Script.print(DateTime.Now.DayOfWeek);// examine a script objectengine.Execute(person { name: Fred, age: 5 });Console.WriteLine(engine.Script.person.name);// read a JavaScript typed arrayengine.Execute(values new Int32Array([1, 2, 3, 4, 5]));var values (ITypedArrayint)engine.Script.values;Console.WriteLine(string.Join(, , values.ToArray()));}稍微看下官网案例就知道怎么用了。 再记录下es6转es5步骤 1.npm执行以下命令 npm install -g babel-cli 安装babel 2.查看版本 babel --version 3.初始化项目 执行npm init -y 4.安装转换包 npm install --save-dev babel-preset-es2015 5.转为新es5语法文件 babel src -d dist 记得把要转换的文件放在项目根目录我把js文件放在根目录下的src文件夹中然后创建.babelrc配置文件在根目录中 内容如下 {presets: [es2015],plugins: [] }然后会在根目录生成新的dist文件夹es5版本的JS在里面。
http://www.pierceye.com/news/330734/

相关文章:

  • 在那里能找到网站泰安公司网站开发
  • 大兴区企业网站建设我们网站的优势
  • 呼伦贝尔市建设局网站关键词如何排名在首页
  • 网站带后台模板网站的建设宗旨
  • 深圳网站建设php专门查企业的网站
  • 做问卷调查的网站有啥世界比分榜
  • 网站301定向深圳电梯广告制作公司网站
  • 个人网站做推广系统开发师
  • 智能建站的优势和不足app注册推广拉人
  • 做网站用软件网站制作怎么创业
  • 解放碑电子商务网站建设网站建设英文如何表达
  • 长春好的做网站公司有哪些网站建设标准
  • 公司网站首页大图怎么做台州网站制作定制
  • 网站建设公司软件开发浅谈网站建设开发
  • 松江网站开发培训课程海外域名注册商
  • 智慧景区网站服务建设线下课程seo
  • 做3个网站需要多大的服务器做地铁建设的公司网站
  • 深圳app网站建设哪家好广西桂林
  • 网站开发及上线过程网站建设备案策划书
  • 杭州九鸿科技网站开发网站模板 素材
  • 网站建设网站软件有哪些wordpress如何输入拼音
  • 昆山网站建设哪家便宜简单的模板网站
  • 做图标得英文网站wordpress写代码插件
  • 网站网页设计案例wordprees可以做棋类网站吗
  • 天河区门户网站官网小学生一分钟新闻播报
  • 漯河网站建设lhwzzz网络服务器机柜
  • 有口碑的武进网站建设国内做房车游网站
  • 山东省城乡住房和城乡建设厅网站济南网站建设wuliankj
  • 网站首页跳出弹窗wordpress远程后台设置
  • 免费信息网站建设平台影响网站排名的因素 权重