PDA

View Full Version : changing from iFrame to script



mailtosaleh
02-28-2007, 07:49 AM
I know I asking too many Questions, But this form is the best I have ever tried,
I am making a website with web contents to be displayed on other website ( like "today in History" –" picture of the day" and so on, The only way I know to show it on other website is by iFrame, which is not good, Is there any way to change this code


<p>
<iframe name="I1" height="222" width="168" src="http://mywebsite.com/webtools/today_in_history.htm" scrolling="no" border="0" frameborder="0" target="_blank">
Your browser does not support inline frames or is currently configured not to display inline frames.
</iframe></p>

To a java or java script, like googles adsense and other ads websites, so the webmasters just include the script in the desired place, and it will retrieve the content from my site
(content may include pictures, scrollers, slide show)

chechu
02-28-2007, 08:06 AM
<div style="width:168px;height:222px;overflow:auto;">
content
</div>

Maybe try this ? (overflow is to make it scrollable)

mailtosaleh
02-28-2007, 08:44 AM
I can't get the Idea,
I need a script to give to website owners to add it to their website, and it will retrieve data from my server

techno_race
03-01-2007, 01:51 AM
Why not just send them the script!?
Anyways,

<script type="text/javascript">
var url = 'yourcontentpage';
var att = 'youriframeattributes';
var alt = 'alternatetext';

document.write('<iframe src="' + url + '" ' + att + '>' + alt + '</iframe');
</script>
should do the trick. It's still an iframe, but in a JavaScript.