Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我使用 C# 为 Windows 应用程序创建了 wcf JSON 休息服务,它有一些方法。现在我想使用 $.getJSON 函数从 javascript 调用其中一种方法。我怎么称呼它。请给我建议
您可以使用以下语法。
$.getJSON({ url:"http://localhost:26850/Service1.svc/HelloWorld?", data: '{"Name":"Testing"}', success:fnsuccesscallback });
还要确保<enableWebScript/>在端点 bahaviour 中进行了配置,以允许从 javascript 调用 wcf 服务。
<enableWebScript/>