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
    CBG
    CBG is offline
    New Coder
    Join Date
    Feb 2010
    Location
    UK
    Posts
    91
    Thanks
    26
    Thanked 0 Times in 0 Posts

    Question Allow members to browse other sites from within my site

    Hi,

    I would like members to be able to browse other websites from within my site.
    I presume I would use an iframe.

    But I was wondering if anyone know of a script I can just drop into my current code.
    Regards,
    CBG

  • #2
    Senior Coder
    Join Date
    Jan 2005
    Location
    Memphis, TN
    Posts
    1,785
    Thanks
    8
    Thanked 131 Times in 129 Posts
    pretty vague request but here:

    Code:
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>jQuery web browser mumbo-jumbo-palooza</title>
    </head>
    <body>
    
    <form action="" method="post">
    	<div>
        <input type="text" name="url" id="url" style="width: 400px;">
        <input type="button" id="submit" value="Blam! Go do your thing!">
        </div>
    </form>
    
    <div id="browser" style="border: 1px solid #000; width: 600px; height: 500px; margin: 10px 0 0 0;"></div>
    
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js"></script>
    <script type="text/javascript">
    $('#submit').click(function(){
    	$('#browser').html('<iframe src="http://'+ $('#url').val() +'" style="width: 600px; height: 500px;"><\/iframe>');	
    });
    </script>
    
    </body>
    </html>
    Stop making things so hard on yourself.
    i is tugbucket :: help raise tugburg :: Whitehaven Kiwanis


  •  

    Posting Permissions

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