Is there good way to get title tag of some other domain page using Javascript?

时间:2018-01-01 02:11:36

标签: javascript jquery html

Like this :

If I'm using jQuery:

    $.ajax({
        url:'https://www.google.com',  
        //some other domain like 'https://facebook.com', Not of my domain that I can control.
        type:'get',
        dataType:'html',
        cache:false,
        success:function (data) {
            var headline = data;
            alert(data);
            $('#div_test').html(data.get_title_tag)
        }
    });

Let me say target url : http://example.com

I googled for a day, and found these.

  1. Iframe

Is it possible, if http://example.com does not allow Iframe access?

As I searched, It's impossible when http://example.com does not allows Iframe access.

  1. Server control

I post http://example.com url data to my server on my url_post_page, and server will do url request stuff, and return data to my url_post_page.

Question :

But I want to get <title>title</title> value of http://example.com just on client using Javascript or jQuery.

Is there any good way of this things?

0 个答案:

没有答案