1
假設我有我的Chrome擴展這個AJAX代碼查找標題
//bind to all links
$('a').click(function() {
//get the url
var url = $(this).prop('href');
//send the url to your server
$.ajax({
type: "POST",
url: "http://yourserver.com/process.php",
data: "url=" + url
});
});
現在,我想送不僅是URL,而且網頁的標題(如HTML規定<title>
標籤)。我怎樣才能得到那個標題?