Forum Moderators: open
There are some sites which let user the option of copy and paste some code from their site to display content of their websites, on other sites. Like google does in their adsense ads or Rss content provider websites.
By using IFrames you can do it. But it can also be done using javascript, like:
<script language='javascript' src='http://www.any-test-site.com/abc.html'></script>
How could I implement this functionality in a website. Any help?
When you "hotlink" a script from another domain, you're just giving them carte blanche to execute script on your page. That script could be anything, from a bunch of document.write()s, to a complex AJAX application. It could even be malware like a keylogger or authentication hack.
In the case of Adsense, their script writes an iframe onto your page and fills that with rendered ads. It may seem mysterious because all the scripting is hidden and unobtrusive, but it's actually *very* simple to do.
Are you seeking to publish your content on other sites, or publish other's content on yours?
The problem is because the iframe's length is smaller vertically for marquee, only part of description thats inside the iframe page is shown the rest of the part(that goes beyond the iframe to the client site) is hidden.
So I was wondering there is a way to display another website content without using IFrame.
By the way this is fifth forum where I have posted my problem in last two days, and not a single reply from atleast fifty views. So thanks alot Webmasterworld, httpwebwitch(your adsense description did helped understanding the concept), StoutFiles.
I think your answer is simple...
Let your clients put a hotlinked script on their sites. It'll look like this:
<script src="http://ww.example.com/yourscript.js"></script>
choose the URL wisely. It must be a permanent location, since you can't go into other people's sites to make changes later!
Then create the JS file and host it on your server.
your JS file could be just a few document.write commands, to inject HTML and scripting into the recipient's DOM.