How can I create a javascript iframe like AdSense

Posted on 2009-04-16
Last Modified: 2012-05-06

I am willing to create a script (PHP) like AdSense but I have not a good knowledge about javascript. So I want to know that how can I create a javascript iframe like AdSense.

Example is given below

Thank you,
<script type="text/javascript">

adplace = "123456";


<script type="text/javascript" src=""></script>

Open in new window

Question by:pnm123
    LVL 75

    Expert Comment

    by:Michel Plungjan
    That is not an example.

    Show a picture or rendered html, please.

    Author Comment

    <script type="text/javascript">
    adplace = "123456";
    <script type="text/javascript" src=""></script>

    I want to let publishers to add a code like above so the js file have to create an iframe like below using the variable given via js (adplace=123456).

    <iframe src=""/></iframe>

    How can I do something like this. Using document write or something with the variables given by the users?
    LVL 75

    Accepted Solution


    if (window.adplace==undefined) adplace='000000';
    document.write('<iframe src="'+adplace+'"/></iframe>')

    Open in new window


    Author Closing Comment

    Thank you very much for your help...

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Join & Write a Comment

    Suggested Solutions

    In this tutorial I will aim to show you how simple is making a small application in WhizBase, how to add, remove and update data in the DB. I will make a small address book application where you can add, browse, update and remove addresses. I wi…
    It is a general practice to get rid of old user profiles on a computer  in a LAN environment. As I have been working with a company in a LAN environment where users move from one place to some other place at times. This will make many user profil…
    Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
    In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…

    728 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

    17 Experts available now in Live!

    Get 1:1 Help Now