skip to Main Content

I am trying to use a icon I have, where when click expands like I am opening a browser and inside that expanded div "browser" pulls up a URL I attach. How do I achieve pulling up a new url thats interactive inside my original index.html without leaving my index.html or opening it on a new tab?

I know how make a div clickable to expand the screen, but not how to make that div turn into the url I want it to be without opening a new tab or leaving my index.html.

2

Answers


  1. You can use Iframes (instead of simple div):

    <iframe src="The url you want to show" title="its description"></iframe>
    

    you can also change its look with css:

    iframe {
        width: 100px;
        height: 100px;
        border: none;
    }
    
    Login or Signup to reply.
  2. Adding to Arshaan’s answer, this may not work if the target site refuses to be iframed (see ).

    If you use a <div> instead of an <iframe>, you may find that you cannot load the other site via AJAX if it is not -enabled. Even if you can load the HTML and insert it into the <div>, if the embedded HTML then loads Javascript, that may interact with the rest of your HTML page in unforseen ways.

    To summarize: This is unlikely to work in general.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search