Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

How can I create a javascript iframe like AdSense

Posted on 2009-04-16
4
Medium Priority
?
656 Views
Last Modified: 2012-05-06
Hi,

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,
pnm123
<script type="text/javascript">
adplace = "123456";
</script>
<script type="text/javascript" src="http://www.mysite.com/show.js"></script>

Open in new window

0
Comment
Question by:pnm123
  • 2
  • 2
4 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 24157722
That is not an example.

Show a picture or rendered html, please.
0
 

Author Comment

by:pnm123
ID: 24165531
<script type="text/javascript">
adplace = "123456";
</script>
<script type="text/javascript" src="http://www.mysite.com/show.js"></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="http://www.yoursite.com/ads.php?id=123456"/></iframe>

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

Accepted Solution

by:
Michel Plungjan earned 400 total points
ID: 24165576
Yes


if (window.adplace==undefined) adplace='000000';
document.write('<iframe src="http://www.yoursite.com/ads.php?id='+adplace+'"/></iframe>')

Open in new window

0
 

Author Closing Comment

by:pnm123
ID: 31570895
Thank you very much for your help...
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to provide a dynamic RTF document on your website generated with data from your database. For this tutorial you will need Microsoft Word or WordPad, WhizBase and Microsoft Access. In this tutorial I will show …
This article is meant to give a basic understanding of how to use R Sweave as a way to merge LaTeX and R code seamlessly into one presentable document.
Learn the basics of lists in Python. Lists, as their name suggests, are a means for ordering and storing values. : Lists are declared using brackets; for example: t = [1, 2, 3]: Lists may contain a mix of data types; for example: t = ['string', 1, T…
Learn the basics of while and for loops in Python.  while loops are used for testing while, or until, a condition is met: The structure of a while loop is as follows:     while <condition>:         do something         repeate: The break statement m…
Suggested Courses

572 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