Hi Karl- Thanks. I really appreciate it. I've got (I think) syntax errors. The firefox console is telling me "missing } after function body \n" - it seems to be the last line of the code and no matter what combination of characters I use there. Here's what I've got:
<script src="http://www.helderberg-bmdc.org/scripts/jquery.js" type="text/javascript"></script> <script type="text/javascript"> /* <![CDATA[ */ $(document).ready(function() { var $extLinks; $("#content a").not("[EMAIL PROTECTED]'helderberg-bmdc.org/']").each(function(index) { if (index == 0) { $extLinks = $('<ol id="extLinks"></ol>'); } var thisHref = this.href; $('<li></li>').text(thisHref).appendTo($extLinks); $extLinks.appendTo("#content"); )}; /* ]]> */ </script> I'm serving the files up as xhtml 1.1 with mime-type application/xhtml+xml for the browsers that understand it and text/html (html 4.01) for the browsers that don't. The page validates and there's no css errors. Thanks in advance for anyone's hints, tips or fixes. Take care. Hugh ----- Original Message ----- From: Karl Swedberg To: jquery-en@googlegroups.com Sent: Monday, July 16, 2007 4:05 PM Subject: [jQuery] Re: search text, find urls and list Hi Hugh, You might want to use the .each() method for this so you can iterate through the links and create new elements as you go. Something like this should work: var $extLinks; $("#content a").not("[EMAIL PROTECTED]'mysite.com/']").each(function(index) { if (index == 0) { $extLinks = $('<ol id="extLinks"></ol>'); } var thisHref = this.href; $('<li></li>').text(thisHref).appendTo($extLinks); }); $extLinks.appendTo("#content"); --Karl _________________ Karl Swedberg www.englishrules.com www.learningjquery.com On Jul 16, 2007, at 3:39 PM, Hugh Hayes wrote: Hi All- This is a newbie designer question. I think jquery's great and I'm trying to find more uses for it. I've got this- $("#content a").not("[EMAIL PROTECTED]'mysite.com/']").clone().appendTo("#content"); I was trying to get a line break in between each link but couldn't and I was hoping somebody here could give me a hand. I'm trying to learn so I'm trying to do this step-by-step. I've been reading the doc's and see that $("a") going to pick up the anchors. I saw .getUrlParam and tried .getUrlParam("href") but was only able to get "strHref has no properties." It's probably obvious but what I'm trying to do is go through the content div, collect all the external "http:..." addresses and put them into a <ul> or <ol> at the bottom of the page. I just want to make it easy for people to copy them. Thanks and thanks for jquery. When you're doing sites by yourself it's hard to add the kind of enhancements that jquery offers. Thanks again, Hugh