How to assign iframe src value at runtime using javascript

Posted on 2008-11-19
Last Modified: 2012-05-05
Dear All,

I am trying to assign iframe src value at runtime. but i was not able to do that. Please help me.

Question by:karups_chennai
    LVL 16

    Accepted Solution

    Here's a simple example of assigning the src value of the iframe using JavaScript:
       function assignSrc()
          document.getElementById("iframeA").src = "";
    <body onload="assignSrc()">
       <iframe id="iframeA" width="800" height="600">

    Open in new window


    Author Closing Comment

    It is working now

    Featured Post

    Maximize Your Threat Intelligence Reporting

    Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

    Join & Write a Comment

    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    I've been asked to discuss some of the UX activities that I'm using with my team. Here I will share some details about how we approach UX projects.
    This video discusses moving either the default database or any database to a new volume.
    In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

    731 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    15 Experts available now in Live!

    Get 1:1 Help Now