Site Notice
hello, world
Difference between revisions of "Short url"
From Project-EPB Commons
([InPageEdit] 没有编辑摘要) |
([InPageEdit] 没有编辑摘要) |
||
Line 11: | Line 11: | ||
}).then(function(data){ | }).then(function(data){ | ||
console.info(data.shortenurl.shorturl); | console.info(data.shortenurl.shorturl); | ||
− | $('url').html(data.shortenurl.shorturl); | + | $('#url').html(data.shortenurl.shorturl); |
}); | }); | ||
} | } | ||
</script> | </script> | ||
</html> | </html> |
Revision as of 02:57, 22 November 2019
<html> <div id="tencent"> <pre id="url"></pre> <input placeholder="https://wjghj.cn" value="https://wjghj.cn" id="request"/> <button onclick="start()">生成</button> </div> <script> function start() {
new mw.Api().post({ action: 'shortenurl', url: $('#request').val() }).then(function(data){ console.info(data.shortenurl.shorturl); $('#url').html(data.shortenurl.shorturl); });
} </script> </html>