I would like to call a WCF service hosted on a remote server, from javascript code withing a web page. I created the user interface with an external java based widgets and controls and would like to retrieve the data which will be in json format.
var data = [
// This information, presumably, would come from a database or web service
{id: 1, value: 20000, site: 1 },
{ id: 2, value: 16000, site: 1 },
{ id: 3, value: 11000, site: 1 },
{ id: 4, value: 1800, site: 1 },
{ id: 5, value: 2600, site: 1 },
{ id: 6, value: 1900, site: 2 },
{ id: 7, value: 20000, site: 2 },
{ id: 8, value: 28000, site: 2 },
{ id: 9, value: 12000, site: 2 },
{ id: 10, value: 40000, site: 2 }
];
the json data will be assigned to this variable data and then displayed in a data grid. If I have the url, how do I call this service? The data would be one field "value" as such:
{"rules":
[
{"value":"rule1"},
{"value":"rule2"}
]
}