1 Star 0 Fork 3

Retaw Jin / baye

forked from Kevin / baye 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
convert.html 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
WangYing 提交于 2016-09-22 01:12 . 生成短网址。
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>网址转换</title>
<script src="http://libs.baidu.com/jquery/1.9.1/jquery.min.js"></script>
</head>
<body>
<script>
function link(url) {
return '<a href="' + url + '">' + url + '</a>';
}
function convert() {
var url = document.getElementById("url-edit").value;
url = 'http://loongw.oschina.io/baye/loadlib.html?' + encodeURI(url);
$("#result").html("版本地址: " + link(url));
$("#short").html('');
$.ajax({
url: "http://50r.cn/urls/add.jsonp?url=" + encodeURI(url),
dataType: "jsonp",
jsonp: "callback",
jsonpCallback: "www_50r_cn_jsonp_callback",
type: "GET",
success: function(resp) {
$("#short").html('缩短网址: ' + link(resp.url));
},
error: function() {
$("#url-title").html("");
$("#url").html("请求失败");
}
});
}
</script>
<input id="url-edit" type="text">
<button onclick="convert()">转换</button>
<br>
<div id="result"></div>
<div id="short"></div>
</body>
</html>
1
https://gitee.com/retaw/baye.git
git@gitee.com:retaw/baye.git
retaw
baye
baye
master

搜索帮助