How to extract a website TITLE, META KEYWORDS and META DESCRIPTION by javascript for example site has exactly extracts [www.example.com] websites TITLE, META KEYWORDS and META DESCRIPTION. How to do it by javascript mainly in HTML? Thankyou!
rakibtg 0 Light Poster
Recommended Answers
Jump to Post— twiss 155Well, assuming you really want JS, you can just do document.getElementsByTagName('title') and ...('meta'). If you actually get this info on another server, without running any code from that page, what I would find more logical, you could use an XML parser or just some regular expression to get the info.
Jump to Post— twiss 155Here's a simple example as for the title: http://www.dreamincode.net/code/snippet4625.htm
Do something similar for the meta tags.
Jump to Post— twiss 155echo getTitle('http://google.com/');
All 10 Replies
twiss 155 Veteran Poster
rakibtg 0 Light Poster
twiss 155 Veteran Poster
rakibtg 0 Light Poster
twiss 155 Veteran Poster
rakibtg 0 Light Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
rakibtg 0 Light Poster
Ezzaral 2,714 Posting Sage Team Colleague Featured Poster
matricol -8 Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.