Suppose I have this AJAX code in my Chrome extension
//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
});
});
Now, I want to send not only the URL, but also the title of the page (as specified in the HTML <title> tag.) How can I get that title?
You could try using
document.title: