浏阳一佳人

学习共享,记录生活

分类 JavaScript 下的文章

December 1, 2017

nodejs 封装网络请求

function postData(url,param,success,type){ var querystring = require('querystring') var URL = require('url'); var os = require('os'); //处理参数 var postData; if (typeof para...
November 10, 2017

JavaScript实现图片URL转DataURL

var img = $('#img').get(0);var canvas = document.createElement("canvas");canvas.width = img.width;canvas.height = img.height;var ctx = canvas.getContext("2d");ctx.drawImage(img, 0, 0, img.width, im...