How can I get the title of a webpage given the url (an external url) using JQuery/JS

后端 未结 3 889
無奈伤痛
無奈伤痛 2020-11-27 03:51

I am a newbie, so excuse me if this is a silly question ..

So what I was trying is to get the title of a URL using JQuery/JS. I dont want to load the content of the

3条回答
  •  囚心锁ツ
    2020-11-27 04:24

    You can also get the title of any webpage using this API

    http://textance.herokuapp.com/title/

    $.ajax({
          url: "http://textance.herokuapp.com/title/www.bbc.co.uk",
          complete: function(data) {
            alert(data.responseText);
          }
    });
    

提交回复
热议问题