赞
踩
代码如下:
- //请写一个两个日期计算的函数
- function dateDiff(date1, date2) {
- return date2.getTime() - date1.getTime();
- }
- var date1 = new Date("2017-03-01");
- var date2 = new Date("2017-03-03");
- console.log(dateDiff(date1, date2));
-
- //请写一个字符串转和日期互转的函数
- function stringToDate(str) {
- return new Date(str);
- }
- function dateToString(date) {
- return date.toString();
- }
- console.log(stringToDate("2018-01-01"));
- console.log(dateToString(new Date("2018-01-01")));
-
- //请把我写调用服端的WEBAPI接口的函数
- function tryrun() {
- //调用WEBAPI接口
- //var result = $.ajax({
- // url: "http://localhost:5000/api/tryrun",
- // type: "POST",
- // data: {
- // "code": "print('hello world')"
- // },
- // dataType: "json",
- // success: function (data) {
- // console.log(data);
- // }
- //});
- //console.log(result);
- }
-
- //请帮写一个echart的柱状图表例子
- var myChart = echarts.init(document.getElementById("main"));
- var option = {
- title: {
- text: "ECharts 入门示例",
- },
- tooltip: {},
- legend: {
- data: ["销量"],
- },
- xAxis: {
- data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"],
- },
- yAxis: {},
- series: [
- {
- name: "销量",
- type: "bar",
- data: [5, 20, 36, 10, 10, 20],
- },
- ],
- };
- myChart.setOption(option);
没成功
总体体验还可以,但是功能不够强大!
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。