Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jun 2009
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    I want to use this script to load videos

    Im trying to use this script tp load videos from the drop down I want to load them into an existing in line frame named ( I2 )
    Can some one help

    <form name="jumpy">
    <select name="example" size="1" onChange="gone()">
    <!-- CHANGE THE BELOW URLS TO YOUR OWN-->
    <option value="http://www.dynamicdrive.com/faqs.htm" selected>FAQs of Dynamic Drive</option>
    <option value="http://www.yahoo.com">Yahoo.com</option>
    <option value="http://www.google.com">Google</option>
    <option value="http://www.lycos.com">Lycos</option>
    <option value="http://www.AltaVista.com">AltaVista</option>
    </select>

    <input type="button" name="test" value="Go!"
    onClick="gone()">
    </form>

    <script language="javascript">
    <!--

    //Drop-down Document Viewer- © Dynamic Drive (www.dynamicdrive.com)
    //For full source code, 100's more DHTML scripts, and TOS,
    //visit http://www.dynamicdrive.com

    //Specify display mode (0 or 1)
    //0 causes document to be displayed in an inline frame, while 1 in a new browser window
    var displaymode=0
    //if displaymode=0, configure inline frame attributes (ie: dimensions, intial document shown
    var iframecode='<iframe id="external" style="width:95%;height:400px" src="http://www.dynamicdrive.com/faqs.htm"></iframe>'

    /////NO NEED TO EDIT BELOW HERE////////////

    if (displaymode==0)
    document.write(iframecode)

    function gone(){
    var selectedurl=document.jumpy.example.options[document.jumpy.example.selectedIndex].value
    if (document.getElementById&&displaymode==0)
    document.getElementById("external").src=selectedurl
    else if (document.all&&displaymode==0)
    document.all.external.src=selectedurl
    else{
    if (!window.win2||win2.closed)
    win2=window.open(selectedurl)
    //else if win2 already exists
    else{
    win2.location=selectedurl
    win2.focus()
    }
    }
    }
    //-->
    </script>

  • #2
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,252
    Thanks
    203
    Thanked 2,557 Times in 2,535 Posts
    var iframecode='<iframe id="I2" style="width:95%;height:400px"

    You must naturally give your iframe the id of I2 as well as the name I2. These are not very good names as I2 is easily confused with the number 12, which can make de-bugging hard. Make the name iFrm2 or something.

    You can detect that this script is pretty old - use of document.all anywhere in a script suggests that the script was originally written for IE4. I would try to get hold of something more up-to-date.

    BTW, please follow the posting guidelines and wrap your code in [code] tags. This means use the octothorpe or # button on the toolbar which will insert opening [ code ] and closing [ /code ] tags - omit the spaces. You can edit your previous post.




    It is your responsibility to die() if necessary….. - PHP Manual
    Last edited by Philip M; 06-22-2009 at 12:08 PM.


  •  

    Posting Permissions

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