<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2652.35">
<TITLE>RE: [Javascript] Problem changing link's href property...</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Anthony, don't send attachments to mailing lists since some will automatically delete without opening because of the threat of viruses. Just post your code in your message:</FONT></P>

<P><FONT SIZE=2>&lt;html&gt;</FONT>
<BR><FONT SIZE=2>&lt;head&gt;</FONT>
<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT SIZE=2>&lt;title&gt;Untitled&lt;/title&gt;</FONT>
<BR><FONT SIZE=2>&lt;script language=&quot;JavaScript&quot; type=&quot;text/javascript&quot;&gt;</FONT>
<BR><FONT SIZE=2>&lt;!-- // swap href in links</FONT>
<BR><FONT SIZE=2>//accepts two parameters: href of link calling swap(), and the new url to swap with.</FONT>
</P>

<P><FONT SIZE=2>function swap(swapHref, newHref) {</FONT>
<BR><FONT SIZE=2>var docLinks = new Array();</FONT>
<BR><FONT SIZE=2>&nbsp; for (i=0; i &lt; document.links.length; i++) {</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp; docLinks[i] = document.links[i].href;</FONT>
<BR><FONT SIZE=2>//&nbsp;&nbsp; alert(docLinks[i]);</FONT>
<BR><FONT SIZE=2>&nbsp; }</FONT>
<BR><FONT SIZE=2>&nbsp; for (i=0; i&lt;docLinks.length; i++) {</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; if (docLinks[i] == swapHref) {</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; document.links[i].href = newHref;</FONT>
<BR><FONT SIZE=2>//&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alert(newHref);</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; }</FONT>
<BR><FONT SIZE=2>&nbsp; }</FONT>
<BR><FONT SIZE=2>}</FONT>
<BR><FONT SIZE=2>// --&gt;</FONT>
<BR><FONT SIZE=2>&lt;/script&gt;</FONT>
<BR><FONT SIZE=2>&lt;/head&gt;</FONT>
</P>

<P><FONT SIZE=2>&lt;body&gt;</FONT>
</P>

<P><FONT SIZE=2>&lt;a href=&quot;test.html&quot; onMouseOver=&quot;swap(this.href, 'new.html');&quot;&gt;test&lt;/a&gt;&lt;br&gt;&lt;br&gt;</FONT>
<BR><FONT SIZE=2>&lt;a href=&quot;test2.html&quot; onMouseOver=&quot;swap(this.href, 'new2.html');&quot;&gt;test2&lt;/a&gt;</FONT>
<BR><FONT SIZE=2>&lt;/body&gt;</FONT>
<BR><FONT SIZE=2>&lt;/html&gt;</FONT>
</P>

<P><FONT SIZE=2>Bob Filipiak (Contractor)</FONT>
<BR><FONT SIZE=2>MCP </FONT>
</P>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: Anthony E. [<A HREF="mailto:apwebdesign@yahoo.com">mailto:apwebdesign@yahoo.com</A>]</FONT>
<BR><FONT SIZE=2>Sent: Friday, July 13, 2001 1:14 PM</FONT>
<BR><FONT SIZE=2>To: javascript@LaTech.edu</FONT>
<BR><FONT SIZE=2>Subject: RE: [Javascript] Problem changing link's href property...</FONT>
</P>
<BR>

<P><FONT SIZE=2>Let me know if this works for you.</FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2>see attached()</FONT>
</P>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>
<BR>

<P><FONT SIZE=2>--- Chris Nafziger &lt;CNafziger@sauder.com&gt; wrote:</FONT>
<BR><FONT SIZE=2>&gt; It didn't help.</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; -----Original Message-----</FONT>
<BR><FONT SIZE=2>&gt; From: Anthony E. [<A HREF="mailto:apwebdesign@yahoo.com">mailto:apwebdesign@yahoo.com</A>]</FONT>
<BR><FONT SIZE=2>&gt; Sent: Thursday, July 12, 2001 7:38 PM</FONT>
<BR><FONT SIZE=2>&gt; To: javascript@LaTech.edu</FONT>
<BR><FONT SIZE=2>&gt; Subject: Re: [Javascript] Problem changing link's</FONT>
<BR><FONT SIZE=2>&gt; href property...</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; try </FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; document.link.jumpTo.href = '/newpath/file.html';</FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; --- Chris Nafziger &lt;CNafziger@sauder.com&gt; wrote:</FONT>
<BR><FONT SIZE=2>&gt; &gt; I'm having a problem with the function below.&nbsp; The</FONT>
<BR><FONT SIZE=2>&gt; &gt; first two lines do what</FONT>
<BR><FONT SIZE=2>&gt; &gt; they are supposed to do just fine.&nbsp; The third line</FONT>
<BR><FONT SIZE=2>&gt; &gt; does manage to change the</FONT>
<BR><FONT SIZE=2>&gt; &gt; URL of the link, however it only works if I use</FONT>
<BR><FONT SIZE=2>&gt; the</FONT>
<BR><FONT SIZE=2>&gt; &gt; ID of zero that you see.</FONT>
<BR><FONT SIZE=2>&gt; &gt; If I replace the the zero with the value assigned</FONT>
<BR><FONT SIZE=2>&gt; to</FONT>
<BR><FONT SIZE=2>&gt; &gt; the link's name</FONT>
<BR><FONT SIZE=2>&gt; &gt; property, 'JumpTo', similar to the first two</FONT>
<BR><FONT SIZE=2>&gt; &gt; function lines, the error</FONT>
<BR><FONT SIZE=2>&gt; &gt; 'document.links.JumpTo' is null or not an object</FONT>
<BR><FONT SIZE=2>&gt; &gt; comes up.&nbsp; Why can't I use</FONT>
<BR><FONT SIZE=2>&gt; &gt; the link's name property value for the reference</FONT>
<BR><FONT SIZE=2>&gt; &gt; like I did with the images?</FONT>
<BR><FONT SIZE=2>&gt; &gt; </FONT>
<BR><FONT SIZE=2>&gt; &gt; </FONT>
<BR><FONT SIZE=2>&gt; &gt; // Function that swaps two images and changes the</FONT>
<BR><FONT SIZE=2>&gt; &gt; link URL </FONT>
<BR><FONT SIZE=2>&gt; &gt; // when one of the swatch image's onMouseover</FONT>
<BR><FONT SIZE=2>&gt; event</FONT>
<BR><FONT SIZE=2>&gt; &gt; fires.</FONT>
<BR><FONT SIZE=2>&gt; &gt; </FONT>
<BR><FONT SIZE=2>&gt; &gt; function imageOn(i)</FONT>
<BR><FONT SIZE=2>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; { </FONT>
<BR><FONT SIZE=2>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; document.images[&quot;Unit&quot;].src =</FONT>
<BR><FONT SIZE=2>&gt; UnitImages[i].src;</FONT>
<BR><FONT SIZE=2>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; document.images[&quot;UnitNumber&quot;].src =</FONT>
<BR><FONT SIZE=2>&gt; &gt; UnitNumberImages[i].src;</FONT>
<BR><FONT SIZE=2>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; document.links[0].href = Page[i] </FONT>
<BR><FONT SIZE=2>&gt; &gt;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT>
<BR><FONT SIZE=2>&gt; &gt; </FONT>
<BR><FONT SIZE=2>&gt; &gt; &lt;a href=&quot;LinkToPage.asp&quot; name=&quot;JumpTo&quot;</FONT>
<BR><FONT SIZE=2>&gt; &gt; id=&quot;JumpTo&quot;&gt;Link&lt;/a&gt;</FONT>
<BR><FONT SIZE=2>&gt; &gt; </FONT>
<BR><FONT SIZE=2>&gt; &gt; _______________________________________________</FONT>
<BR><FONT SIZE=2>&gt; &gt; Javascript mailing list</FONT>
<BR><FONT SIZE=2>&gt; &gt; Javascript@LaTech.edu</FONT>
<BR><FONT SIZE=2>&gt; &gt; <A HREF="http://www.LaTech.edu/mailman/listinfo/javascript" TARGET="_blank">http://www.LaTech.edu/mailman/listinfo/javascript</A></FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; __________________________________________________</FONT>
<BR><FONT SIZE=2>&gt; Do You Yahoo!?</FONT>
<BR><FONT SIZE=2>&gt; Get personalized email addresses from Yahoo! Mail</FONT>
<BR><FONT SIZE=2>&gt; <A HREF="http://personal.mail.yahoo.com/" TARGET="_blank">http://personal.mail.yahoo.com/</A></FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; _______________________________________________</FONT>
<BR><FONT SIZE=2>&gt; Javascript mailing list</FONT>
<BR><FONT SIZE=2>&gt; Javascript@LaTech.edu</FONT>
<BR><FONT SIZE=2>&gt; <A HREF="http://www.LaTech.edu/mailman/listinfo/javascript" TARGET="_blank">http://www.LaTech.edu/mailman/listinfo/javascript</A></FONT>
<BR><FONT SIZE=2>&gt; </FONT>
<BR><FONT SIZE=2>&gt; _______________________________________________</FONT>
<BR><FONT SIZE=2>&gt; Javascript mailing list</FONT>
<BR><FONT SIZE=2>&gt; Javascript@LaTech.edu</FONT>
<BR><FONT SIZE=2>&gt; <A HREF="http://www.LaTech.edu/mailman/listinfo/javascript" TARGET="_blank">http://www.LaTech.edu/mailman/listinfo/javascript</A></FONT>
</P>
<BR>

<P><FONT SIZE=2>__________________________________________________</FONT>
<BR><FONT SIZE=2>Do You Yahoo!?</FONT>
<BR><FONT SIZE=2>Get personalized email addresses from Yahoo! Mail</FONT>
<BR><FONT SIZE=2><A HREF="http://personal.mail.yahoo.com/" TARGET="_blank">http://personal.mail.yahoo.com/</A></FONT>
</P>

</BODY>
</HTML>