How to extract a website TITLE, META KEYWORDS and META DESCRIPTION by javascript for example www.surfpack.com/example_com 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 PostWell, 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 PostHere's a simple example as for the title: http://www.dreamincode.net/code/snippet4625.htm
Do something similar for the meta tags.
Jump to Postecho 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.