SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    loading database data into javascript

    loading database data into javascript

    --------------------------------------------------------------------------------

    heya- im doing javascript code where ive got a menu system- where i can click on a folder and it expands into futher options.

    this menu is on the side of my page. this is in my main code and is part of my script. Now i want the options in the menu to display names that i have in a database. how would i be able to do this- because my menu code is all based in the script???

    e.g.
    a menu option would be

    Code:
    SWEBSITES = theMenu.addEntry(-1, "Folder", "Web syts", "Home.asp", "Web syts");
    {
    SWEBSITES = theMenu.addChild(SWEBSITES, "Document", "NEW", "http://www.google.com", "New");
    }
    while (i <= 1)
    i want the option so that the submenu/ addchild displays data from my database where it says NEW in Bold.
    any coding or suggestions??
    thanks

  2. #2
    Caveat surfer Buddy Bradley's Avatar
    Join Date
    May 2003
    Location
    Cambridge, UK
    Posts
    2,366
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You'd need a server-side language like PHP or ASP to retrieve the data from the table - the easiest way to do it would be to use the query result to populate Javascript arrays which are then used to build the menu.

  3. #3
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    loading database data into javascript

    well ive got the menu built up and its working.

    so would i need to do the asp code before the script- because the data from the database will be used in the javascript- to name options??

    is there any good tutorials out there on javascript arrays and javascript in intermediate and advance???
    thanks

  4. #4
    SitePoint Member
    Join Date
    Nov 2006
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Buddy Bradley
    You'd need a server-side language like PHP or ASP to retrieve the data from the table - the easiest way to do it would be to use the query result to populate Javascript arrays which are then used to build the menu.
    how can i find out more about query results in asp. is query result part of asp programming or sql.
    finally do you know any way how i could link javascript variables to retrieve the query result.
    thanks


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
  •