开发者

How easy will it be to build AJAX powered website in PHP compared to ASP.NET?

I know that in ASP.NET there is built in Ajax that can 开发者_运维知识库make your life easier. What about PHP?


My approach to AJAX in PHP has always been very simple.... From my limited exposure to ASP.Net and AJAX, I think you'll be pleasantly surprised.

I use jQuery for the client side, so simple $.get() and $.post() calls to the script in question ("get_city_list.php", etc.) do the trick on that end.

Then, in PHP, you just build a response and echo it. So if I just need a simple textual response, echo the text as the last step in your PHP script and you're done.

If you need a more complex result set, json_encode() does wonders on arrays, simplifying the JSON model tremendously.

I'd definitely say there's much less hassle working with AJAX in PHP than the .Net platform, but that's from relatively little experience WITH the .Net platform.

Hope that helps!


There's jQuery which is now bundled with ASP.NET. You could perfectly fine use it with PHP as well.


You can found many php ajax frameworks you can also find here popular ajax frameworks


Choose the one you know the best and are most comfortable with using. There are AJAX frameworks for both and sometimes the "built in" stuff isn't as good as it originally sounds. (esp. if you're talking about the AjaxControlToolkit).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜