Extracting page title

Discussion in 'JavaScript' started by aweoing, Feb 1, 2012.

  1. #1
    I'm trying to extract the page title by using a url.

    You know how "document.title" returns the title of the current page? well I was wondering if i could say "'http://google.com'.title" (doesn't work) or something similar to get the title of another page. thx for any ideas
     
    aweoing, Feb 1, 2012 IP
  2. maureeeteeeee

    maureeeteeeee Member

    Messages:
    15
    Likes Received:
    0
    Best Answers:
    2
    Trophy Points:
    41
    #2
    You'll need a PHP script for this.
    By using get_file_contents($url) and fetching the title.
     
    maureeeteeeee, Feb 1, 2012 IP
  3. aweoing

    aweoing Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    heres my response (i got error when i tried to post the entire thing) pastebin.com/mYuBhyDA
     
    aweoing, Feb 1, 2012 IP
  4. JohnnySchultz

    JohnnySchultz Peon

    Messages:
    277
    Likes Received:
    4
    Best Answers:
    7
    Trophy Points:
    0
    #4
    i think its file_get_contents
     
    JohnnySchultz, Feb 2, 2012 IP
  5. NothingLikeThis

    NothingLikeThis Member

    Messages:
    113
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    26
    #5
    in javascript,its little harder to get title of the window as title is out of the web page while you can easily get web page content
     
    NothingLikeThis, Feb 4, 2012 IP