Novice needs help

Discussion in 'Javascript' started by Bob Leffew, Aug 13, 2003.

  1. Bob Leffew

    Bob Leffew Guest

    I have inherited a program using javascript and am trying to learn the
    language.

    I have a problem I cant figure out.

    On my page I have a form with a List/Menu inside of a form.

    the value of the list box is a name that corresponds with a jpg in a defined
    directory and also corresponds with a html page in a defined directory.

    When you click on the List/Menu in real time the corresponding image changes
    accordingly and when the image is clicked on the correct page opens.

    But when I tried adding a new value to the Lis/Menu in development, in real
    time the image changes but html page does not. (Value of html remains
    contant)

    I definitely added a jpg into the proper directory with the proper value
    name and also created a html page with the proper name.

    All I can figure out is when I add in new values some type of index must be
    being kept but I cant figure out where.

    Any suggestions?

    Below is code from program:

    <script language="JavaScript1.2" cyberversion="N1.2"><!--

    function PreLoad() {
    var doc=document;
    if(doc.images){
    if(!doc.newarray) doc.newarray=new Array();
    var x,y=doc.newarray.length,a=PreLoad.arguments;
    for(x=0; x<a.length; x++)
    if (a[x].indexOf("#")!=0){
    doc.newarray[y]=new Image; doc.newarray[y++].src=a[x];
    }
    }
    }

    function PreLoadAll() {
    PreLoad('images/npabout.gif', 'images/npctcat.gif', 'images/npcontact.gif',
    'images/npfloorplan.gif', 'images/npform.gif', 'images/nphelp.gif',
    'images/npshoppinglist.gif', 'images/nptdcat.gif',
    'images/thumbnails/CustomCabinets.jpg');
    }

    function changeReadout(newReadout)

    {

    // change image for nav readout

    window.document.np.src = newReadout;

    }

    function changeProduct(selectedProduct)

    {
    if (selectedProduct == ""){
    } else {
    // changeout product image

    var newSrc = "images/thumbnails/" + selectedProduct + ".jpg";
    window.document.preview.src = newSrc;

    // changeout product link address

    var newPreviewLink = "catalog/" + selectedProduct + ".html";
    window.document.links[16].href = newPreviewLink;
    }
    }

    function OpenList()
    {
    window.open('catalog/preview.html','ListWindow','width=400,height=500,direct
    ories=no,location=no,menubar=no,scrollbars=yes,status=yes,toolbar=no,resizab
    le=no,status=no,titlebar=no');
    }
    -->
    </script>

    Thanks,

    Bob Leffew
     
    Bob Leffew, Aug 13, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rodney Edmondson
    Replies:
    3
    Views:
    375
    David Segall
    Nov 25, 2003
  2. Blankdraw

    Novice needs jump-start w/ MVC Studio

    Blankdraw, Aug 12, 2003, in forum: C Programming
    Replies:
    1
    Views:
    351
    Jack Klein
    Aug 13, 2003
  3. Clueless in Seattle

    Novice Needs Help Editing Web Page

    Clueless in Seattle, Apr 15, 2007, in forum: HTML
    Replies:
    4
    Views:
    342
    dorayme
    Apr 16, 2007
  4. Replies:
    63
    Views:
    2,118
    Mike Schilling
    Aug 26, 2009
  5. OysterCracker

    Preload Audio? - Novice Needs Help

    OysterCracker, Feb 18, 2004, in forum: Javascript
    Replies:
    2
    Views:
    125
    fenian
    Feb 19, 2004
Loading...

Share This Page