Indeed, probably so. It was just a suggestion. A ----------------------------- Andy Woznica
Actofdesign http://www.actofdesign.com On 11/13/06 10:17 AM, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > What is the point of leaving out the 'target' attribute if you are then > going to put it in via JavaScript? If it shouldn't be there then don't > use it - sneaking it in via a script seems rather pointless to me. > > Mike > >> -----Original Message----- >> From: listdad@webstandardsgroup.org >> [mailto:[EMAIL PROTECTED] On Behalf Of Andy Woznica > > >> Essentially it's a script to open all external links in a >> new window with a >> slight modification to recognise a substring in a form tag >> and do likewise. >> Anyway, here's the JavaScript: >> >> // JavaScript Document >> function externalLinks() { >> if (!document.getElementsByTagName) return; >> var anchors = document.getElementsByTagName("a"); >> for (var i=0; i<anchors.length; i++) { >> var anchor = anchors[i]; >> if (anchor.getAttribute("href") && >> anchor.getAttribute("rel") == "external") >> anchor.target = "_blank"; >> } >> >> var forms = document.getElementsByTagName("form"); >> for(var i = 0; i < forms.length; i++) >> { >> var form = forms[i]; >> if(form.getAttribute("id").substring(0, 6) == "paypal") >> { >> form.target = "_blank"; >> } >> } >> } > > > ******************************************************************* > List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm > Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm > Help: [EMAIL PROTECTED] > ******************************************************************* ******************************************************************* List Guidelines: http://webstandardsgroup.org/mail/guidelines.cfm Unsubscribe: http://webstandardsgroup.org/join/unsubscribe.cfm Help: [EMAIL PROTECTED] *******************************************************************