summaryrefslogtreecommitdiffstats
path: root/jquery-insert-href-icon.xhtml
diff options
context:
space:
mode:
authorKyle K <kylek389@gmail.com>2013-06-15 19:52:17 -0500
committerKyle Kaminski <kyle@kkaminsk.com>2013-06-15 19:52:17 -0500
commitf5f461aaf9f08951fa3990e49b51a076f7036b16 (patch)
treedeaf01c5633ef17b885d00546e7ea085ab1d1652 /jquery-insert-href-icon.xhtml
downloadwebsandbox-f5f461aaf9f08951fa3990e49b51a076f7036b16.tar.gz
websandbox-f5f461aaf9f08951fa3990e49b51a076f7036b16.tar.bz2
websandbox-f5f461aaf9f08951fa3990e49b51a076f7036b16.zip
initial commit
Diffstat (limited to 'jquery-insert-href-icon.xhtml')
-rw-r--r--jquery-insert-href-icon.xhtml32
1 files changed, 32 insertions, 0 deletions
diff --git a/jquery-insert-href-icon.xhtml b/jquery-insert-href-icon.xhtml
new file mode 100644
index 0000000..fc17640
--- /dev/null
+++ b/jquery-insert-href-icon.xhtml
@@ -0,0 +1,32 @@
+<!-- interesting how // escaped that dot from xml pickery -->
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<title>inserting icon beside href anchors</title>
+<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+<script type="text/javascript" src="jquery-2.0.2.js"></script>
+<script type="text/javascript">
+ <![CDATA[
+ $("document").ready(function() {
+ <!-- selector 'a' is next to the filter, $= denotes 'ends with' -->
+ $("a[href$=\\.mp3]").after(" <img src='small-mp3.png' />");
+ });
+ ]]>
+</script>
+</head>
+<body>
+<h2>List:</h2>
+<ul>
+ <li><a href="foo.mp3">Van Halen - Panama</a></li>
+ <li><a href="foo.pdf">NPN 4401 BJT Transistor</a></li>
+ <li><a href="foo.pdf">All That Remains - Empty Inside</a></li>
+ <li><a href="foo.mp3">Led Zeppelin - Stairway To Heaven</a></li>
+ <li><a href="foo.html">Boobs</a></li>
+ <li><a href="foo.html">Spam</a></li>
+ <li><a href="foo.mp3">Pink Floyd - On The Run</a></li>
+</ul>
+</body>
+</html>
+