Suz wrote:
> I'm trying to get a Javascript from Nick Heinle's book to work. It's
> supposed to change the location of both my toolbar frame and my main page
> frame.
>
> In the book, Heinle has written it like this:
> function changePages(toolbarURL, mainURL) {
>
>
> I'm getting a Javascript error "missing ) after formal parameters" that
> points to the dot in guestbooknav.html .
>
> This is how I have it typed:
>
> <SCRIPT LANGUAGE=JAVASCRIPT>
> <!-- Hide script from old browsers
>
> function changePages(guestbooknav.html,guestbook.html) {
> parent.navbar.location.href="guestbooknav.html";
> parent.main.location.href="guestbook.html";
>
> }
>
> // End hiding script from old browsers -->
> </SCRIPT>
No gaurantee's, but try:
function changePages('guestbooknav.html','guestbook.html') {
or
function changePages("guestbooknav.html","guestbook.html") {
Actually, looking at your code, I don't see why you can't just use:
> function changePages() {
since the values used in the ()'s don't appear to be being used later
(actually, the value equivalents are used, but they're hard coded). Maybe
you've omitted parts of the script here?
A more likely way for this code to work would be something like:
function changePages(frame1,frame2) {
parent.navbar.location.href=frame1;
parent.main.location.href=frame2;
where the values for frame1 and frame2 come are passed to the function, from
a mouseover maybe:
onMouseOver="changePages('guestbooknav.html', 'guestbook.html')"
The two values between the ()'s in the changesPages function call (above)
are "inserted" into the function changePages as frame1 and frame2.
I'm not versed in javascript and it's syntax, but that's my 2c.
Jack
____________________________________________________________________
--------------------------------------------------------------------
Join The Web Consultants Association : Register on our web site Now
Web Consultants Web Site : http://just4u.com/webconsultants
If you lose the instructions All subscription/unsubscribing can be done
directly from our website for all our lists.
---------------------------------------------------------------------