Author: Aamir Hasan
PHP updated support for Microsoft AJAX Library. It works with the RTM bits, and fixes several of the issues reported in my earlier samples. , so that you can join in and contribute to the project.The Microsoft AJAX Library is a standalone collection of the standards-based JavaScript classes included in Microsoft ASP.NET AJAX. it simply supports exposing PHP classes as AJAX-enabled web services, just as in ASP.NET applications. In fact, the generated proxies are identical to what you get from ASP.NET
Test Example
<?php
require_once '../../dist/MSAjaxService.php';
class TestService extends MSAjaxService
{
function SayHello($name)
{
return 'Welcome, ' . $name . '!';
}
}
$h = new HelloService();
$h->ProcessRequest();
?>
Index.html
<html>
<head>
<title>Hello, World!</title>
<script type="text/javascript" src="../../MicrosoftAjaxLibrary/MicrosoftAjax.js"></script>
<script type="text/javascript" src="HelloService.php/js"></script>
</head>
<body>
Name: <input id="name" type="text" /> <input type="button" value="Say Hello" onclick="button_click(); return false;" />
<br />
Response from server: <span id="response"></span>
</body>
<script type="text/javascript">
function button_click() {
TestService.SayHello($get('name').value, function (result) { $get('response').innerHTML = result; });
}
</script>
</html>
Oh, and if you are interest in PHP, you might want to check out the FastCGI work on IIS to make PHP rock on IIS7.
Author:
Aamir Hasan औथोर:
आमिर हसन أثر
أمير حسن .
eadf533b-ae9c-4fcf-8aee-ee7db4edbbda|0|.0
Ajax, Javascript, PHP
asp.net, ajax, php,