WorldofASP.NET : ASP.NET Directory, Tutorial, Hosting, and Source Code
You are 1 of 184 users


Using the Microsoft AJAX Library with PHP

Blogger : Brian Goldfarbs Blog : ASP.NET
All posts : All posts by Brian Goldfarbs Blog : ASP.NET
Category : AJAX
Blogged date : 2007 Jan 23

Steve Marx has been working behind the scenes on building out a community project to create native PHP support for the Microsoft AJAX Library.  Today he released the first version.  He provides a ton of details in this post which I steal liberally from below.

First download ASP.NET AJAX or grab just the client side Microsoft AJAX Library

Second, check out the codeplex project

Third, code away -- you can contribute bugs, code and more at the CodePlex site -- I think this is pretty darn cool and when you think about this in terms of our FastCGI work on IIS things are getting very cool for developers in any language/platform.

Check out this HelloWorld sample code:

 

<?php
 
require_once '../../dist/MSAjaxService.php';
 
class HelloService extends MSAjaxService
{
    function SayHello($name)
    {
        return "Hello, " . $name . "!";
    }
}
 
$h = new HelloService();
$h->ProcessRequest();
 
?>

index.html:
<html>
<head>
<title>Hello, World!</title>
<script type="text/javascript" src="http://blogs.msdn.com/bgold/archive/2007/01/23/../../MicrosoftAjaxLibrary/MicrosoftAjax.js"></script>
<script type="text/javascript" src="http://blogs.msdn.com/bgold/archive/2007/01/23/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() {
        HelloService.SayHello($get('name').value, function (result) {
            $get('response').innerHTML = result;
        });
    }
</script>
</html>

Definitely let us know what you think!


Read comments or post a reply to : Using the Microsoft AJAX Library with PHP
Page 1230 of 1924
Next | Last

.NET News Categories








Legend : - Within 3 Days - Within 6 Days - Within 9 Days

Home | Add Resources | Sponsored Listings | Advertise with Us | SiteMap 1 | SiteMap 2 | Link To Us | Contact Us
© 2002-2008 Worldofasp.net ASP.NET Directory, Hosting and Tutorials | All rights reserved
Our Partners : ASP.NET Web Hosting | Windows Web Hosting | ASP.NET Hosting | Phone Card | PHP Directory | Bangkok Hotels |Calling Card