Site Notice

hello, world

Difference between revisions of "Short url"

From Project-EPB Commons
([InPageEdit] 没有编辑摘要 (第1部分))
([InPageEdit] 没有编辑摘要)
Line 1: Line 1:
== 腾讯 ==
 
* url.cn
 
 
<html>
 
<html>
 
<div id="tencent">
 
<div id="tencent">
<iframe style="border:none; width:100%; height:1.8em;" class="tc-s-url" scrolling="no"></iframe>
+
<pre id="url"></pre>
<input placeholder="https://wjghj.cn" value="https://wjghj.cn" class="urlRequest"/> <button onclick="getTencent()">生成</button>
+
<input placeholder="https://wjghj.cn" value="https://wjghj.cn" id="request"/> <button onclick="start()">生成</button>
 
</div>
 
</div>
 
<script>
 
<script>
function getTencent() {
+
function start() {
   $('.tc-s-url').attr('src','https://sa.sogou.com/gettiny?url='+$('#tencent .urlRequest').val());
+
   new mw.Api().post({
 +
    action: 'shortenurl',
 +
    url: $('#request').val()
 +
  }).done(function(data){
 +
    $('url').html(data.shortenurl.shortenurl);
 +
  });
 
}
 
}
 
</script>
 
</script>
 
</html>
 
</html>

Revision as of 02:51, 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()
 }).done(function(data){
   $('url').html(data.shortenurl.shortenurl);
 });

} </script> </html>