172 users online (0 members and 172 guests)  

  Results 1 to 1 of 1


  1. Adding values to an external .js Javascript file?    Forum: Javascript Forum
    Replies: 3
  2. [SPLIT]passing values to an external .js file    Forum: Javascript Forum
    Replies: 37
  3. Replies: 1
  4. help checking form elements in external js file    Forum: Javascript Forum
    Replies: 2
  5. passing values to an external .js file    Forum: Javascript Forum
    Replies: 10
  1. #1
    DavoNeedsHelp's Avatar
    New User

    Join Date
    Sep 2007

    need help with onclick link to external .JS file

    Anyone mind showing me how to display data from a .Js file?
    Just wanting to write the first prodName variable inside a sep. html page. I am using onclick="" with an "alert" to bring up a box showing the prodName[0] item text "Home Theat.."
    inside HTML
    <input type="button" onclick="result=(); alert(result);">
    Price $ <input type="text" id="productinfo">
    <script type="AssignOne.js">
    Inside AssignOne.Js
    var prodName = new Array();            //product name and model array 
     prodName[0] = "Home Theatre System HT400DVA";
     prodName[1] = "Digital Home Theatre System SD1000W";
     prodName[2] = "Portable CD Player QT180H";
     prodName[3] = "Portable CD Player GX1200W";
     prodName[4] = "Microwave Oven R230";
     prodName[5] = "Microwave Oven R380H";
     prodName[6] = "DVD Recorder DV350X";
     prodName[7] = "DVD Recorder DV300X";
     prodName[8] = "Personal Digital Assistant SL550";
    Last edited by vinyl-junkie; 09-19-2007 at 06:03 AM. Reason: Added code tags

Tags for this Thread