I would like to make a news feed. So people can copy and paste code into their web page. Everytime their page loads it then displays news I specify. How do you go about doing this?
Any help on this subject would be much appreciated.
Then you edit/maintain the file short.php. Maybe short.php contains some server side code that queries your local mySQL database and massages some news into javascript variables... and then document.writes them.
When the user includes your script on their page, you will be document.writing directly onto their page... so you can include a link that clicks-back to your main website (maybe).
You can perform a similar task to generate an XML feed as well if you wanted!
The standard way of doing this is using RSS (Really Simple Syndication) which is an xml feed.
This would be a little more complex (but still Really Simple apparently!) than the js solution suggested but is much more flexible and it would even be possible for people to get you news on their desktop using a news reader.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.