How to get the RSS URL in javascript?
-
How do I access the RSS URL defined in the tag of a page, using javascript? I want to use a bookmarklet to capture the RSS URL of the page I'm looking at. I'm sure there must be a document.something property that I could access, but I don't know enough javascript to figure it out.
-
Answer:
teaperson at Ask.Metafilter.Com Visit the source
Other answers
The bookmarklet was stripped by Mefi's XSS filtering - I figured that would happen. Visit Laughing Meme for the unfiltered bookmarklet.
slhack3r
I wrote one that turns out to be nearly the same as the previous answer, but I don't want it to be for naught:javascript:var links = document.getElementsByTagName('link'); for (var i = 0; links[i] && links[i].getAttribute('type') != 'application/rss+xml'; ++i); if (links[i] && links[i].hasAttribute('href')) alert(links[i].getAttribute('href'));
moift
This one will alert for all if there are multiples instead of just the firstjavascript:var links = document.getElementsByTagName('link'); for (var i = 0; links[i]; ++i) { if (links[i].getAttribute('type') == 'application/rss+xml' && links[i].hasAttribute('href')) alert(links[i].getAttribute('href')); }
moift
Related Q & A:
- How to Get Current Browser URL in Code Behind?Best solution by stackoverflow.com
- How to get live stream url from youtube live?Best solution by Stack Overflow
- how to get a hangout url from the hangout button?Best solution by Stack Overflow
- How to get the previous URL after using window.history.back?Best solution by stackoverflow.com
- How to get current YouTube video url using JavaScript?Best solution by Stack Overflow
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.