views:

25

answers:

1

Hi there

I have a recruitment portal that people can use to advertise and search for jobs.

I would like the recruiters to be able to add a small javascript snippet to their personal websites, that will list jobs on my site.

how can i go about this?

I have webservices set up so the javascript can just call that, but i also need the result to be formatted and placed inline.

This should work in a simular way to google adsense.

I would really appreciate a small example

+1  A: 

The easies way to do this is to have a piece of javascript that includes an iframe pointing to a custom page on your server.

document.write("%3Ciframe src='http://foo.com/page/' style='border:0px'%3E%3C/iframe%3E");

If you want to inject the content directly into the document then you must deal with retrieving the data, and with the manipulation of the DOM.

The fact that you are posting this questions leads me to believe that the first option is the correct one for you.

Sean Kinsey
i was initially contemplating th latter of manipulating the dom, but my javascript is not that great, a was able to do this using jQuery, but this would mean that the user would have to include the jQuery library on their site.Thanx for the response, i will make use of the iframe :)
Dusty Roberts
Exactly my point :)
Sean Kinsey