How to embed external scripts results within a page?

Discussion in 'JavaScript' started by Souljacker, Jun 5, 2008.

  1. #1
    Here's what I'm trying to accomplish:

    I have a PHP script at my site that returns the 5 last itens in my feed.

    I want people to be able to embed this in their site just by some code at it.

    How can I accomplish this?
     
    Souljacker, Jun 5, 2008 IP
  2. crath

    crath Well-Known Member

    Messages:
    661
    Likes Received:
    33
    Best Answers:
    0
    Trophy Points:
    100
    #2
    Make a javascript file that they include by adding this code to their website.

    <script type="text/javascript" src="http://www.yourdomain.com/yourwebsitestuff/file.js"></script>

    then, in this file, have ajax set up and have it run the php file and take the returned value and document.write it and you can style it how ever you wish.
     
    crath, Jun 5, 2008 IP