JSRender is a jscript template engine very much similar to JQuery templates. It is replacing JQuery templates in the near future and still in beta. The main advantage of any template engine is to reduce the jscript code for rendering dhtml with some data. JSRender can be used with or without using JQuery.
Please visit below link to know more about JSRender
Here, in this example, I will try to explain how you can use Bing Search API to render a search interface with JSRender.
Bing Search API exposes http endpoints that can provide results in XML or JSON. Please visit below link for more information on Bing Search API
Bing API URL format
Bing Search API request consists of following required and optional parameters
1) AppID : Your site application key provided by Bing.
2) Query: Search text
3) Sources: Web or Images etc..
1) Web.Offset: Offset 0 means first page
2) Web.Count: Total number of records to be fetched.
>Please note that in order to hide my APPID and misuse, I have installed an application on my server to reverse proxy bing api. What I mean is in the example code there is no direct api calling to bing website but it has to go through my site.
All the api requests initiated to my site doesn’t require any APIID but Query and sources parameters are required.
Access source at JSFiddle.net