The Microsoft AJAX Library is a pure-JavaScript library that is used by ASP.NET AJAX but is also available as a separate download. Because it is pure JavaScript, it is not tied to ASP.NET on the backend. PHP for MS AJAX is code to help you make use of the Microsoft AJAX Library from PHP applications. With this first Alpha release, 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, meaning you can have full interoperability.
Hello World
The service on the backend so to speak:
PLAIN TEXT
HTML:
1.
2.
<?php
3.
4.
require_once ../../dist/MSAjaxService.php;
5.
6.
class HelloService extends MSAjaxService
7.
{
8.
function SayHello($name)
9.
{
10.
return "Hello, " . $name . "!";
11.
}
12.
}
13.
14.
$h = new HelloService();
15.
$h->ProcessRequest();
16.
And the front end that will talk to it:
PLAIN TEXT
HTML:
1.
2.
<html>
3.
<head>
4.
<title>Hello, World!</title>
5.
<script type="text/javascript" src="../../MicrosoftAjaxLibrary/MicrosoftAjax.js"></script>
6.
<script type="text/javascript" src="HelloService.php/js"></script>
7.
</head>
8.
<body>
9.
Name: <input id="name" type="text" />
10.
<input type="button" value="Say Hello" onclick="button_click(); return false;" />
11.
<br />
12.
Response from server: <span id="response"></span>
13.
</body>
14.
<script type="text/javascript">
15.
function button_click() {
16.
HelloService.SayHello($get(
ame).value, function (result) {
17.
$get( aresponse).innerHTML = result;
18.
});
19.
}
20.
</script>
21.
</html>
22.
source: ajaxian
Related Stuff
-
MooV: Using cutting edge Video phones and Software Video Phones - coupling all that with VoIP and empowering the disabled.
-
Moo Telecom: VoIP communications made easy - Ring anyway with the fun and ease of using a normal phone
-
TagR:Mobile Social Network with Real Time Locations Based services, and Ambience Intelligence, VoiP, IM, Skype, Googletalk, Mapping, Flickr, Events, Calendaring, Scheduling, SecondLife Support
-
ClearSMS : ClearSMS is a Web-based application that lets you send bulk SMS messages to your customers, contacts, or just about anyone.
-
Jajah:jah is a VoIP (Voice over IP) provider, founded by Austrians Roman Scharf and Daniel Mattes in 2005[1]. The Jajah headquarters are located in Mountain View, CA, USA, and Luxembourg. Jajah maintains a development centre in Israel.
-
Skype: It’s free to download and free to call other people on Skype. Skype the number one voice over ip software
- PrivatePhone: a free local phone number with voicemail and messages you can check online or from any phone.
Be the first ... |Add your comment.
Your Comment ...
Name (required)
Email (required, hidden)
Website
