Hayla

JS 001

Jun 6th, 2020
366
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.95 KB | None | 0 0
  1. <script src='http://bit.ly/javascript-api.js?version=latest&amp;login=wahatinfo&amp;apiKey=R_6795ee07e9a640488d62f80f0ac2e5d5' type='text/javascript'/>
  2. <script type='text/javascript'>
  3. BitlyClient.addPageLoadEvent(function(){
  4. BitlyCB.myShortenCallback = function(data) {
  5. // this is how to get a result of shortening a single url
  6. var result;
  7. for (var r in data.results) {
  8. result = data.results[r];
  9. result[&#39;longUrl&#39;] = r;
  10. break;
  11. }
  12. document.getElementById(&quot;shorturl&quot;).innerHTML = &quot;<div id='shorternh2'>شارك المقال مع أصدقائك</div> &lt;input type=&#39;text&#39; class=&#39;textinpo&#39; value=&#39;&quot; + result[&#39;shortUrl&#39;] + &quot;&#39; name=&#39;bitlyurl&#39;/&gt;&quot;;}
  13. BitlyClient.shorten(document.location, &#39;BitlyCB.myShortenCallback&#39;);
  14. });
  15. </script>
Add Comment
Please, Sign In to add comment