Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8580797
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T20:54:13+00:00 2026-06-11T20:54:13+00:00

I have an input box for user to enter any url. Then I would

  • 0

I have an input box for user to enter any url. Then I would like to display the website in a iframe after they click submit.

<html>
    <head>
        <title></title>
        <style>
            #netframe {
                float:right; 
                height: 100%; 
                width: 80%;
            }

            #sidebar {
                float:left; 
                height: 100%; 
                width: 20%;
            }
        </style>
    </head>
    <body>
        <div id="container">
            <div id="sidebar">
                Enter A URL:
                <input type="text" name="url" id="url">
                <input type="button" value="load" id="load">
                <br><br>    
            </div>
            <div id="netframe">
                <iframe height="100%" width="100%" class="netframe" src="pullsite.php" id="main_frame"></iframe>
            </div>
        </div>
    </body>
</html>

This is the closest I found online but it does not do anything:
How To Reload A iframe Using jQuery

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T20:54:14+00:00Added an answer on June 11, 2026 at 8:54 pm

    Try to add the following JS / jQuery script to your code:

    <script>
        $(function() {
            $("#load").click(function() {
                var new_url = $("#url").val();
    
                // Checks that the user typed "http://" or not
                if(new_url.substr(0,7)!="http://")
                    new_url = "http://"+new_url;
    
                $("#main_frame").attr("src", new_url);
            });
         });
    </script>
    

    So, your code will look like something like this:

    <html>
        <head>
            <title></title>
            <script type="text/javascript"  src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
            <style>
                #netframe {
                    float:right; 
                    height: 100%; 
                    width: 80%;
                }
    
                #sidebar {
                    float:left; 
                    height: 100%; 
                    width: 20%;
                }
            </style>
            <script>
                $(function() {
                    $("#load").click(function() {
                        var new_url = $("#url").val();
    
                        // Checks that the user typed "http://" or not
                        if(new_url.substr(0,7)!="http://")
                            new_url = "http://"+new_url;
    
                        $("#main_frame").attr("src", new_url);
                    });
                 });
            </script>
        </head>
        <body>
            <div id="container">
                <div id="sidebar">
                    Enter A URL:
                    <input type="text" name="url" id="url">
                    <input type="button" value="load" id="load">
                    <br><br>    
                </div>
                <div id="netframe">
                    <iframe height="100%" width="100%" class="netframe" src="pullsite.php" id="main_frame"></iframe>
                </div>
            </div>
        </body>
    </html>
    

    PS: Don’t forget to load the jQuery library. You can load it from the web for example, by adding the following in your header:

    <script type="text/javascript"  src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
    

    Hope this helps. Let me know if this works for you mate.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Have a text input box. Would like the user to enter a string in
I have an EditText box where the user can enter input. I need to
I am want to have a input box, where a user can add or
I have a string value from a user input box. I have to figure
I have a text-box into which a user can input a comment. The comment
I have an input box which is limited to 16 Numbers. What I'd like
Quick question... I have an input box that upon key enter, adds the value
I have an Input Box on my Form. When user types in, say, a
We have a page which requires user to enter some input and post submission
I have an input box in my web app, If I type the following

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.