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

平台网站应该怎样做seo磁力天堂最佳搜索引擎入口

平台网站应该怎样做seo,磁力天堂最佳搜索引擎入口,形象类网站,建怎样的网站挣钱快之前测试了很多JS引擎,都只支持es5语法,不支持执行es6,测试了下微软的V8反正能跑通,应该是支持的。还得是微软呀。 如图:安装相关包: 这是参考的官方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 = $"corp=kuwo&p2p=1&type=convert_url2&sig=0&format={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 = (ITypedArray<int>)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.dt0577.cn/news/52827.html

相关文章:

  • 上海网站建设品牌英文seo推广
  • 怎么用网站做类似微博30个免费货源网站
  • 企业建设网站应该一般多少钱制作电商网站
  • 苏州网站建设哪家好百度品牌广告收费标准
  • 利用淘宝视频服务做视频网站前端开发培训机构推荐
  • 委托建设网站合同范本3 #65533;如何做好一个网站
  • 做博彩网站代理犯法吗疫情最新数据消息地图
  • 观山湖区网站建设上海最近3天疫情情况
  • 宁夏企业网站建设国家提供的免费网课平台
  • 婚介网站方案外贸如何推广
  • 网站建设哪里找百度投诉中心在线申诉
  • 哪个网站可以做记录视频深圳搜索引擎
  • 对做网站公司的疑问百度云盘搜索引擎入口
  • 微网站 淘宝客外贸推广营销公司
  • 济南网站建设 联系小七html网页制作app
  • 郑州网站建设专注乐云seo企业邮箱账号
  • 贵阳有哪些可以制作网站的公司品牌营销策略分析论文
  • 琪恋网站建设电商平台app大全
  • 无锡免费做网站北京seo顾问
  • 怎么做网站呢重庆seo网站哪家好
  • 手机网站开发实例网站整站优化公司
  • 公司网站需求说明书免费发布产品信息的网站
  • 上海建设协会网站电商培训机构排名
  • 自己建网站百度到吗百度网页版入口链接
  • 网站编辑怎么做的今天发生的新闻
  • 仿中国化妆品网站模板企业宣传视频
  • 网站制作论文致谢广州seo优化费用
  • 东莞市微网站官方网站949公社招聘信息
  • 辽阳北京网站建设百度的推广广告
  • 成都官网优化多少钱成都抖音seo