/    Sign up×
Community /Pin to ProfileBookmark

Feel so hopeless! Can’t make Javascript work

Hi every1

I’m a graohic designer and my boss sometimes gets me to do web stuff.

And he emailed me this script and told me to make it work. So I used another client’s website and made a test page at http:[url]www.geoffdutton.com/test.html[/url] BUT I CAN’T MAKE IT WORK!!!!

Here’s what he emailed me — can anyone help? It’s my first time touching Javascript

Cyn

<!– TWO STEPS TO INSTALL GALLERY VIEWER:

  • 1. Copy the coding into the HEAD of your HTML document

  • 2. Add the last code into the BODY of your HTML document –>
  • <!– STEP ONE: Paste this code into the HEAD of your HTML document –>

    <HEAD>

    <SCRIPT LANGUAGE=”JavaScript”>
    <!– Original: Jenny Blewitt ([email protected]) –>
    <!– Web Site: [url]http://www.webdesignsdirect.com[/url] –>

    <!– This script and many more are available free online at –>
    <!– The JavaScript Source!! [url]http://javascript.internet.com[/url] –>

    <!– Begin
    browserName = navigator.appName;
    browserVer = parseInt(navigator.appVersion);

    ns3up = (browserName == “Netscape” && browserVer >= 3);
    ie4up = (browserName.indexOf(“Microsoft”) >= 0 && browserVer >= 4);

    function doPic(imgName) {
    if (ns3up || ie4up) {
    imgOn = (“” + imgName);
    document.mainpic.src = imgOn;
    }
    }
    // End –>
    </script>
    </HEAD>

    <!– STEP TWO: Copy this code into the BODY of your HTML document –>

    <BODY>

    <center>
    <table width=360 border=0 cellspacing=0 cellpadding=0>
    <tr>
    <td><a href=”javascript:doPic(‘p1.jpg’);”><img src=”p1.jpg” width=90 height=60 border=0></a></td>
    <td><a href=”javascript:doPic(‘p2.jpg’);”><img src=”p2.jpg” width=90 height=60 border=0></a></td>
    <td><a href=”javascript:doPic(‘p3.jpg’);”><img src=”p3.jpg” width=90 height=60 border=0></a></td>
    <td><a href=”javascript:doPic(‘p4.jpg’);”><img src=”p4.jpg” width=90 height=60 border=0></a></td>
    </tr>
    <tr>
    <td colspan=4 align=center><img name=”mainpic” src=”p1.jpg” width=360 height=240 border=0></td>
    </tr>
    <tr>
    <td><a href=”javascript:doPic(‘p5.jpg’);”><img src=”p5.jpg” width=90 height=60 border=0></a></td>
    <td><a href=”javascript:doPic(‘p6.jpg’);”><img src=”p6.jpg” width=90 height=60 border=0></a></td>
    <td><a href=”javascript:doPic(‘p7.jpg’);”><img src=”p7.jpg” width=90 height=60 border=0></a></td>
    <td><a href=”javascript:doPic(‘p8.jpg’);”><img src=”p8.jpg” width=90 height=60 border=0></a></td>
    </tr>
    </table>
    </center>

    <p><center>
    <font face=”arial, helvetica” size=”-2″>Free JavaScripts provided<br>
    by <a href=”http://javascriptsource.com”>The JavaScript Source</a></font>
    </center><p>

    to post a comment
    JavaScript

    2 Comments(s)

    Copy linkTweet thisAlerts:
    @HaganeNoKokoroSep 09.2005 — Right now on your page, you have things that look like this:&lt;a href="javascript:doPic('[color=red]gad-01.jpg[/color]');"&gt;&lt;img src="[color=blue]/images/gad-01.jpg[/color]" width=76 height=82 border=0&gt;&lt;/a&gt;Right now, the script tries to use a non-existent image because you are not providing a path to the image file. You need to change the red part to be the same as the blue part.

    You may also want to consider making small thumbnails rather than simply downsizing the large images, and making the images and thumbnails a standard size, so that the browser doesn't have to do resizing (browsers resize images with low-quality interpolation like nearest-neighbor). In that case, the thumbnail image (blue part) will be different from the full-sized image (red part).
    Copy linkTweet thisAlerts:
    @cyndiiauthorSep 09.2005 — OH WOW you are so-o-o-o amazing, Haga!

    I'm way stoked to have that one solved.

    On Monday I'll do what you said for the thumbnails and make it all OK. I need to fit in some captions to each thumb, but I guess that's just a case of pasting the script into the table cells hey?

    Have a mighty weekend ya?

    Cheers

    Cyn
    ×

    Success!

    Help @cyndii spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 6.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @nearjob,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,

    tipper: @meenaratha,
    tipped: article
    amount: 1000 SATS,
    )...