greetings, fellow internet!

welcome to digitalgangster.com, the coolest community for people who hack the gibson and make bajillions of dollars off of online marketing. please click here to register an account (it's free) and join in on a plethora of discussions with the internet elite.

ASGPHE,
ytcracker, original digital gangster
follow me on twitter
fan me on facebook
Results 1 to 11 of 11

Thread: javascript owning me help

  1. #1

    Join Date
    Mar 2008
    Location
    The poster formally known as ChewY.
    Posts
    952

    Default javascript owning me help

    firefox says national[0][0][1] has no properties even though i made it an option element.

    var national = new Array();
    national[0] = new Array();
    national[0][0] = new Array();
    national[0] = "United States";
    national[0][0] = document.createElement("option");
    national[0][0].text = "United States";
    national[0][0].value = "flags/usa.gif";
    national[0][0][0] = document.createElement("option");
    national[0][0][0].text = "5x9 - $9.99";
    national[0][0][0].value = 9.99;
    national[0][0][1] = document.createElement("option");
    national[0][0][1].text = "10 x 18 - $34.99";
    national[0][0][1].value = 34.99;
    national[0][0][2] = document.createElement("option");
    national[0][0][2].text = "50 x 90 - $934.99";
    national[0][0][2].value = 934.99;
    Quote Originally Posted by SilentAssassin View Post
    your dick is like fast food

  2. #2
    yung skeet pulaskeet's Avatar
    Join Date
    Jan 2007
    Location
    atlanta and nyc
    Posts
    1,000

    Default

    Quote Originally Posted by dimeroll View Post
    firefox says national[0][0][1] has no properties even though i made it an option element.

    var national = new Array();
    national[0] = new Array();
    national[0][0] = new Array();
    national[0] = "United States";
    national[0][0] = document.createElement("option");
    national[0][0].text = "United States";
    national[0][0].value = "flags/usa.gif";
    national[0][0][0] = document.createElement("option");
    national[0][0][0].text = "5x9 - $9.99";
    national[0][0][0].value = 9.99;
    national[0][0][1] = document.createElement("option");
    national[0][0][1].text = "10 x 18 - $34.99";
    national[0][0][1].value = 34.99;
    national[0][0][2] = document.createElement("option");
    national[0][0][2].text = "50 x 90 - $934.99";
    national[0][0][2].value = 934.99;
    it's because you're trying to make an option inside an option

  3. #3
    yung skeet pulaskeet's Avatar
    Join Date
    Jan 2007
    Location
    atlanta and nyc
    Posts
    1,000

    Default

    i dont know what youre trying to do, but i expanded on what i said to show you how it should look...

    Code:
    var national = new Array();
    national[0] = new Array();
    national[0][0] = new Array();
    national[0] = "United States";
    national[0][0] = document.createElement("option");
    national[0][0].text = "United States";
    national[0][0].value = "flags/usa.gif";
    national[0][1] = document.createElement("option");
    national[0][1].text = "5x9 - $9.99";
    national[0][1].value = 9.99;
    national[0][2] = document.createElement("option");
    national[0][2].text = "10 x 18 - $34.99";
    national[0][2].value = 34.99;
    national[0][3] = document.createElement("option");
    national[0][3].text = "50 x 90 - $934.99";
    national[0][3].value = 934.99;
    this makes an array of options... united states followed by 5x9 - 9.99, 10 x 18 - 34.99... etc

    if you wanted them to be seperate lists, then incease the first part of the array (national[1][0] = ....; national[1][0] = "5x9 x 9.99";...)

  4. #4

    Join Date
    Mar 2008
    Location
    The poster formally known as ChewY.
    Posts
    952

    Default

    Quote Originally Posted by pulaskeet View Post
    i dont know what youre trying to do, but i expanded on what i said to show you how it should look...

    Code:
    var national = new Array();
    national[0] = new Array();
    national[0][0] = new Array();
    national[0] = "United States";
    national[0][0] = document.createElement("option");
    national[0][0].text = "United States";
    national[0][0].value = "flags/usa.gif";
    national[0][1] = document.createElement("option");
    national[0][1].text = "5x9 - $9.99";
    national[0][1].value = 9.99;
    national[0][2] = document.createElement("option");
    national[0][2].text = "10 x 18 - $34.99";
    national[0][2].value = 34.99;
    national[0][3] = document.createElement("option");
    national[0][3].text = "50 x 90 - $934.99";
    national[0][3].value = 934.99;
    this makes an array of options... united states followed by 5x9 - 9.99, 10 x 18 - 34.99... etc

    if you wanted them to be seperate lists, then incease the first part of the array (national[1][0] = ....; national[1][0] = "5x9 x 9.99";...)
    I'm planning to use three arrays. Dimension 1 simply holding a string for indexing purposes, dimension2 holding an option element with the name of the country and the value holding a path to a gif of its flag, dimension three an array of options holding flag description w/ price in the value section.
    Quote Originally Posted by SilentAssassin View Post
    your dick is like fast food

  5. #5

    Join Date
    Mar 2008
    Location
    The poster formally known as ChewY.
    Posts
    952

    Default

    Quote Originally Posted by pulaskeet View Post
    it's because you're trying to make an option inside an option
    so ur saying when i make [0][0] into an option element, that [0][0][0] is created because the option object has an array in itself?

    btw <3 delilah
    Quote Originally Posted by SilentAssassin View Post
    your dick is like fast food

  6. #6

    Join Date
    Mar 2008
    Location
    The poster formally known as ChewY.
    Posts
    952

    Default

    Quote Originally Posted by pulaskeet View Post
    i dont know what youre trying to do, but i expanded on what i said to show you how it should look...

    Code:
    var national = new Array();
    national[0] = new Array();
    national[0][0] = new Array();
    national[0] = "United States";
    national[0][0] = document.createElement("option");
    national[0][0].text = "United States";
    national[0][0].value = "flags/usa.gif";
    national[0][1] = document.createElement("option");
    national[0][1].text = "5x9 - $9.99";
    national[0][1].value = 9.99;
    national[0][2] = document.createElement("option");
    national[0][2].text = "10 x 18 - $34.99";
    national[0][2].value = 34.99;
    national[0][3] = document.createElement("option");
    national[0][3].text = "50 x 90 - $934.99";
    national[0][3].value = 934.99;
    this makes an array of options... united states followed by 5x9 - 9.99, 10 x 18 - 34.99... etc

    if you wanted them to be seperate lists, then incease the first part of the array (national[1][0] = ....; national[1][0] = "5x9 x 9.99";...)
    hmm i'ma have to rethink my array schema
    Quote Originally Posted by SilentAssassin View Post
    your dick is like fast food

  7. #7

    Join Date
    Mar 2008
    Location
    The poster formally known as ChewY.
    Posts
    952

    Default

    Hmm well i could make two seperate arrays
    national

    [0]United States-string
    [0][0]USA-option element
    [0][1]Texas-option element
    [0][2]New York-option element
    [1]Mexico
    [1][0]Mexico-option element
    [2][1]Mexican State-option element
    [2]Canada
    [2][0]Canada-option element
    [2][1]Ontario-option element
    ect....

    then another array called
    prices
    [0]United States -string
    [0][0]2x5 - option element
    [0][1]9x16 - option element
    [1]Texas - String
    [1][0]2x5 - option element
    [1][1]9x16 - option element

    id really like them in the same array tho for speed
    Last edited by dimeroll; 04-19-2008 at 05:29 PM.
    Quote Originally Posted by SilentAssassin View Post
    your dick is like fast food

  8. #8

    Join Date
    Mar 2008
    Location
    The poster formally known as ChewY.
    Posts
    952

    Default

    ultimate goal is to slang flags
    Quote Originally Posted by SilentAssassin View Post
    your dick is like fast food

  9. #9
    yung skeet pulaskeet's Avatar
    Join Date
    Jan 2007
    Location
    atlanta and nyc
    Posts
    1,000

    Default

    you might have missed what I was saying. Pm me with your aim, I'll explain more thoroughly on aim (I'd post here but I'm on my iPhone)

  10. #10
    qbert's Avatar
    Join Date
    Feb 2005
    Location
    Backwoods fucklord
    Posts
    54,748

    Default

    man pulaskeet, you are too nice

    chewy, you're an idiot

    good luck slanging flags
    most boring signature of all time

  11. #11
    yung skeet pulaskeet's Avatar
    Join Date
    Jan 2007
    Location
    atlanta and nyc
    Posts
    1,000

    Default

    Quote Originally Posted by qbert View Post
    man pulaskeet, you are too nice

    chewy, you're an idiot

    good luck slanging flags
    lol yea maybe but i learned all the coding i know online. back in pr vb, people used to be cool with info, so i try to keep that going

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •