Creating IFrame through javascript.

java , javascript United States
  • 10 years ago

    I want to create and laod IFrame in my page through Javascript.

    Thanks in advance for any help.

  • 10 years ago

    Hi GMike,

    Is this what you want to do?

    <script language="JavaScript" type="text/javascript">
    function makeFrame() {
       ifrm = document.createElement("IFRAME");
       ifrm.setAttribute("src", ""); = 640+"px"; = 480+"px";
    <p><a href="#" onMouseDown="makeFrame()">GO! </a></p>



  • 10 years ago


    Thanks a lot you have given me the exact idea. keep it up man.

    Thanks again

  • 7 years ago



    This solve my problem which takes my hours to solve.

  • 5 years ago


    Thanks I was looking for this solution as well.

Post a reply

Enter your message below

Sign in or Join us (it's free).


Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.” - Brian Kernighan