Results 1 to 4 of 4

Thread: what is the difference between these two pages.

  1. #1
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    597
    Thanks
    43
    Thanked 28 Times in 28 Posts

    Default what is the difference between these two pages.

    The red part in the second page is different

    Code:
    <!doctype html>
    <html>
    <head>
    <title> Your Title </title>
    
    </head>
    <body bgcolor="#FFFFFF" text="#000000" link="#0000cc" vlink="#cc0000" alink="#FFffFF">
    
    <table>
    <tr>
    <td>
    <form name="dynamiccombo">
    <select name="stage2" size="1" onchange="gothere()">
    <option value="#">This is a Place Holder</option>
    <option value="#">This is a Place Holder</option>
    <option value="#">This is a Place Holder</option>
    </select>
    <input type="hidden" name="test" value="Go!"
    onClick="gothere()">
    </form>
    
    <script>
    <!--
    
    //Dynamic combo box script- by javascriptkit.com
    //Visit JavaScript Kit (http://javascriptkit.com) for script
    //Credit must stay intact for use
    
      
    //DEFINE the group of links for display in the combo
    //EXTEND each array and its elements as needed
    //BE sure to follow the pattern revealed below
    var combo1=new Array()
    combo1[0]=new Option("JavaScript Kit","http://javascriptkit.com")
    combo1[1]=new Option("Dynamic Drive","http://www.dynamicdrive.com")
    combo1[2]=new Option("Freewarejava.com","http://www.freewarejava.com")
    combo1[3]=new Option("Free Web Templates","http://www.freewebtemplates.com")
    combo1[4]=new Option("Web Monkey","http://www.webmonkey.com")
    
    var combo2=new Array()
    combo2[0]=new Option("CNN","http://www.cnn.com")
    combo2[1]=new Option("MSNBC","http://www.msnbc.com")
    combo2[2]=new Option("BBC News","http://news.bbc.co.uk")
    combo2[3]=new Option("ABC News","http://www.abcnews.com")
    
    var combo3=new Array()
    combo3[0]=new Option("Hollywood.com","http://www.hollywood.com")
    combo3[1]=new Option("MTV","http://www.mtv.com")
    combo3[2]=new Option("ETOnline","http://etonline.com")
    
    
    var cacheobj=document.dynamiccombo.stage2
    
    function populate(x){
    for (m=cacheobj.options.length-1;m>0;m--)
    cacheobj.options[m]=null
    selectedarray=eval(x)
    for (i=0;i<selectedarray.length;i++)
    cacheobj.options[i]=new Option(selectedarray[i].text,selectedarray[i].value)
    cacheobj.options[0].selected=true
    }
    
    function gothere(){
    location=cacheobj.options[cacheobj.selectedIndex].value
    }
    
    //SHOW first combo by default
    populate(combo1)
    
    //-->
    </script>
    </td>
    <td>
    <!--SET up your links, and pass in the name of the group (ie: combo1) you wish to display for the link in question-->
    <a href="javascript:populate(combo1)">Webmaster sites</a> | <a href="javascript:populate(combo2)">News sites</a> | <a href="javascript:populate(combo3)">Entertainment</a>
    </td>
    </tr>
    </table>
    
    <p align="center">This free script provided by<br />
    <a href="http://javascriptkit.com">JavaScript
    Kit</a></p>
    </body>
    </html>
    This one is different:

    Code:
    <!doctype html>
    <html>
    <head>
    <title> Your Title </title>
    
    </head>
    <body bgcolor="#FFFFFF" text="#000000" link="#0000cc" vlink="#cc0000" alink="#FFffFF">
    
    <table>
    <tr>
    <td>
    <form name="dynamiccombo">
    <select name="stage2" size="1" onchange="gothere()">
    <option value="#">This is a Place Holder</option>
    <option value="#">This is a Place Holder</option>
    <option value="#">This is a Place Holder</option>
    </select>
    <input type="hidden" name="test" value="Go!"
    onClick="gothere()">
    </form>
    
    <script>
    <!--
    
    //Dynamic combo box script- by javascriptkit.com
    //Visit JavaScript Kit (http://javascriptkit.com) for script
    //Credit must stay intact for use
    
      
    //DEFINE the group of links for display in the combo
    //EXTEND each array and its elements as needed
    //BE sure to follow the pattern revealed below
    var combo1=new Array()
    combo1[0]=new Option("JavaScript Kit","http://javascriptkit.com")
    combo1[1]=new Option("Dynamic Drive","http://www.dynamicdrive.com")
    combo1[2]=new Option("Freewarejava.com","http://www.freewarejava.com")
    combo1[3]=new Option("Free Web Templates","http://www.freewebtemplates.com")
    combo1[4]=new Option("Web Monkey","http://www.webmonkey.com")
    
    var combo2=new Array()
    combo2[0]=new Option("CNN","http://www.cnn.com")
    combo2[1]=new Option("MSNBC","http://www.msnbc.com")
    combo2[2]=new Option("BBC News","http://news.bbc.co.uk")
    combo2[3]=new Option("ABC News","http://www.abcnews.com")
    
    var combo3=new Array()
    combo3[0]=new Option("Hollywood.com","http://www.hollywood.com")
    combo3[1]=new Option("MTV","http://www.mtv.com")
    combo3[2]=new Option("ETOnline","http://etonline.com")
    
    var curlevel=1
    var cacheobj=document.dynamiccombo.stage2
    
    function populate(x){
    for (m=cacheobj.options.length-1;m>0;m--)
    cacheobj.options[m]=null
    selectedarray=eval(x)
    for (i=0;i<selectedarray.length;i++)
    cacheobj.options[i]=new Option(selectedarray[i].text,selectedarray[i].value)
    cacheobj.options[0].selected=true
    
    }
    
    function displaysub(){
    if (curlevel==1){
    populate(cacheobj.options[cacheobj.selectedIndex].value)
    curlevel=2
    }
    else
    gothere()
    }
    
    
    function gothere(){
    if (curlevel==2){
    if (cacheobj.selectedIndex==cacheobj.options.length-1){
    curlevel=1
    populate(category)
    }
    else
    location=cacheobj.options[cacheobj.selectedIndex].value
    }
    }
    
    
    
    //SHOW first combo by default
    populate(combo1)
    
    //-->
    </script>
    </td>
    <td>
    <!--SET up your links, and pass in the name of the group (ie: combo1) you wish to display for the link in question-->
    <a href="javascript:populate(combo1)">Webmaster sites</a> | <a href="javascript:populate(combo2)">News sites</a> | <a href="javascript:populate(combo3)">Entertainment</a>
    </td>
    </tr>
    </table>
    
    <p align="center">This free script provided by<br />
    <a href="http://javascriptkit.com">JavaScript
    Kit</a></p>
    </body>
    </html>
    all the red colored code is different(I think there are differences at least.

    Does the sceond allow for subcatergories?
    Thanks,

    Bud

  2. #2
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    597
    Thanks
    43
    Thanked 28 Times in 28 Posts

    Default

    No one can tell me if the second script is different as to being able to handle sub-catergories??

    And if it is how??
    Thanks,

    Bud

  3. #3
    Join Date
    Jul 2008
    Location
    Derbyshire, UK
    Posts
    2,039
    Thanks
    16
    Thanked 316 Times in 314 Posts
    Blog Entries
    13

    Default

    I'm only running key lines through a Google search but the first script appears to be this: http://www.javascriptkit.com/script/...lticombo.shtml

    And the second appears to be this: http://www.javascriptkit.com/script/...velcombo.shtml

    So yes, you can see from the demo pages that the second allows for a second level.
    Focus on Function Web Design | Latest News RSS | Facebook | Twitter |
    Fast Edit (A flat file, PHP web page editor & CMS. Small, FREE, no database!) | Fast Edit BE (Snippet Manager) (Web content editor for multiple editable regions!) | Fast Apps |
    The only limit to creativity is imagination: JemCon.org

  4. The Following User Says Thank You to Beverleyh For This Useful Post:

    ajfmrf (04-01-2013)

  5. #4
    Join Date
    Jan 2011
    Location
    Southeastern CT
    Posts
    597
    Thanks
    43
    Thanked 28 Times in 28 Posts

    Default

    So it is not the same script,how did I get that mixed up?

    I don;t remember using never mind seeing that 2 level combo before.

    Any thanks Beverlyh
    Thanks,

    Bud

Similar Threads

  1. AnyLink works fine in pages, but not when those pages are in frames
    By jddela in forum Dynamic Drive scripts help
    Replies: 9
    Last Post: 03-11-2010, 04:27 AM
  2. What's the difference between <td> and <th> tag?
    By heavensgate15 in forum HTML
    Replies: 7
    Last Post: 06-28-2009, 03:10 PM
  3. Difference between GIF and SWF
    By Bornfree in forum Flash
    Replies: 8
    Last Post: 10-20-2007, 03:59 PM
  4. Replies: 3
    Last Post: 06-27-2007, 10:02 PM
  5. difference gif - jpg
    By chechu in forum Graphics
    Replies: 7
    Last Post: 11-17-2006, 03:39 PM

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
  •