PDA

View Full Version : going to new page with Javascript links..



pencil2print
06-26-2010, 01:12 PM
hey all.

I am new to javascripting, and it's confusing to a beginner!

I am using a Dreamweaver preset template that has javascript for the links.

yet, I can't figure out how to make the links go to another page! It does nothing when clicked and I think I entered in the code wrong to direct it to the page requested.

note: pages aren't up as of now. I believe it should at least give you a page error when clicked on the link. (if it does work, it'd probably take you to an old page that I am revising)

http://warrenvillerailroad.com/index4.html

I tried different variations, but its probably something completely different from what I was trying.

azoomer
06-26-2010, 02:44 PM
Did you try just changing it from this;
<a href="javascript:;about.html">About WarrenVille</a>
to this
<a href="http://warrenvillerailroad.com/about.html">About WarrenVille</a>

pencil2print
06-26-2010, 03:53 PM
it seemed to work, i think. lol

I thought if I took out the javascript:; section, it'd lose the script effects

auntnini
06-26-2010, 09:59 PM
Right!– If you just want to link to a page, use standard HTML <a href="indexPage.html">click link </a>. But calling a JavaScript function from an HTML <a href="#nogo"> link </a> can have some interesting aspects. I forget the term -- "JavaScript link"?

For instance, I call an open pop-window function to give viewer some source info without sending them away from site (http://www.chanit.com, http://www.jacquimorgan.com, http://www.josephdenaro.com)'




<p class="footnote"> CREDITS: &nbsp; (1) Web design & animation by Denise deGoumois <a href="javascript:myopen('http://www.auntnini.com')">http://www.auntnini.com</a><br>
(2) Omni Image View, Fade, and/or Slide (&quot;vfs&quot;) Script ©2008 <a href="javascript:myopen('http://home.comcast.net/~jscheuer1/side/vfs/vac_plain.htm')">John Davenport Scheuer</a> as discussed at <a href="javascript:myopen('http://www.dynamicdrive.com/forums/showthread.php?t=43787')">Dynamic Drive Forums</a></p>

Here are some links I found on the subject (maybe not the best):

"Using HREF JavaScript Links" http://computerprogramming.suite101.com/article.cfm/using_href_javascript_links

"Using Link Tags with JavaScript" http://www.pageresource.com/jscript/jlinktut.htm

"HREF for Javascript links: “#” or “javascript:void(0)”?" http://stackoverflow.com/questions/134845/href-for-javascript-links-or-javascriptvoid0

pencil2print
06-26-2010, 10:08 PM
thanks for the links! I have some reading and learning to do!