Widget creation

Hi, I want to create a widget that can be embedded on other sites similar to the Twitter profile widget, here is an example:

http://twitter.com/about/resources/widgets/widget_profile

The way I would approach this is to return data in json format via my wcf, the problem is that the twitter example seems to have javascript, and I'm not going to cling to it. My question to more experienced developers is whether I am on the right track and what else do I need to do. thanks a lot

+4
source share
2 answers

The goal of javascript would be to actually call your wcf service to retrieve the data and write the html results to the screen. In the twitter example, many parameters are set inside the javascript object, which is used to control the configuration (background color, username, etc.). You can return json and then take values ​​from json and connect them to the client side html template. If you want this to be used on other sites, I would probably avoid using jquery, since you cannot be sure that the user has enabled it, and therefore you will need to enable it. And then you have problems with the versions, if you are using an older version, and you want to use a newer version on the website that hosts your widget.

+1
source

There is an interesting blog post explaining how to create a widget, safely load jquery and css, creating JSONP calls, and much more: How to create a web widget (using jQuery)

+1
source

All Articles