1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

passing variable to argument in method

Discussion in 'JavaScript' started by gvm, Oct 17, 2006.

  1. #1
    function shirtSize(){
    var sml = 'small';
    location="JavaScript:top.HIDDEN.addtoCart('shirt, T + sml', 6.00)";
    }

    As is, the return shows: shirt, T sml, $6.00.
    I want the return to show: shirt, T small, $6.00.

    I'm not sure what to do here...thanks for any help.
     
    gvm, Oct 17, 2006 IP
  2. gvm

    gvm Guest

    Messages:
    39
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Changing this line:
    location="javascript:top.HIDDEN.addtoCart('shirt, T + sml', 6.00)";

    to this line solved the problem,
    location="javascript:top.HIDDEN.addtoCart('shirt, T "+sml+"', 6.00)";
     
    gvm, Oct 17, 2006 IP