-
-
Save masterpoppy/bb29f10ff8913847ce880c0de34cb6f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('a[href^=http]').click(function(e) { //正規表現をつかってhttpを含む<a>タグを抽出する | |
//ハイパーリンクのデフォルトのクリックイベントをキャンセル | |
e.preventDefault(); | |
//リンクURLの内容をajaxでhttp-inに送信 | |
$.ajax({ | |
'type': 'POST', | |
'url': location.href, | |
'data': JSON.stringify({ | |
'link': this.href | |
}) | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment