I have incorporated Snap Shots into my blog the other day but wish to make it only work for links that are pointing to wikipedia.org.
In the FAQ page they tell me to use
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- //<[CDATA[
- var links = document.getElementsByTagName('a');
- for (var l = 0; l < links.length; l++) {
- if(links[l].href.match(/^http:\/\/www\.example\.com/)){
- links[l].className += " snap_shots";
- }
- }
- //]]>
- </script>
I have come up with this on
Expand|Select|Wrap|Line Numbers
- <script type="text/javascript">
- <![CDATA[
- var links = document.getElementsByTagName('a');
- for (var l = 0; l < links.length; l++) {
- if(links[l].href.match(/^http:\/\/en\.wikipedia\.org\/wiki\//)){
- links[l].className += " snap_shots";
- }
- }
- ]]>
- </script>
Any help?
Thank you,
Marat Levit
www.mlevit.blogspot.com