Xaxax alternative?

I really like the simplicity of xajax calls with PHP, however the xajax project seems dead by now ... Is there a good alternative or equivalent of xajax that is being actively developed?

+4
source share
6 answers

Ok, in my whole project I am writing all javascript code using jQuery . This is a very powerful javascript library that has a full arsenal of DOM manipulation and AJAX request code.

There are several attempts to encapsulate jQuery in php, so jQuery code can be called inside php code, and the corresponding jQuery code will be included in the page output. But for myself, I prefer to write all javascript code inside the script tags in the view file (I use CodeIgniter).

jQuery is actively developing, and the latest version (1.4) starts just a few days ago.

+2
source

The new alternative to Xajax is sijax. Although official support is listed in the python module, there is a gijub hosting for the sijax project. This is a PHP library that integrates the jQuery and xajax object mentality to provide a quick and easy usecase but powerful backend.

https://github.com/spantaleev/sijax

+3
source

Yes, please see PHPLiveX . It is lightweight, and there with further development. Thanks

Code example:

  function generateRandomCode($length){ $chars = array("1","2","3","4","5","6","a","b","c","d","e","f"); $code = array_rand(array_flip($chars), $length); return implode($code); } // Necessary PHPLiveX Codes include("PHPLiveX.php"); $ajax = new PHPLiveX(array("generateRandomCode")); $ajax->Run(); // Must be called inside the 'html' tags. <input onclick="generateRandomCode(10, {'target':'rcode','preloader':'pr'});" type="button" value="Generate Random Code" > <img id="pr" src="design/Progressbar2.gif" style="visibility:hidden;"> <span id="rcode"></span> 
+1
source

I do not think that there is a more advanced PHP / jQuery / AJAX library than my Phery library ( http://phery-php-ajax.net/ ), using it and coding it for more than 2 years. A close connection to all that jQuery has to offer is esplendid and automatically supports past, present and future versions of jQuery.

You can even access the original caller using PheryResponse::factory()->this() , you can manipulate any DOM on the page directly from within PHP, and even pass raw javascript callbacks to jQuery from PHP using the PheryFunction class

Code example:

 Phery::instance() ->set(array( // You don't need to use lambda functions, but it the power of PHP 5.3 ;) 'alias-for-function' => function($ajax_data){ ob_start(); var_dump($ajax_data); $data = ob_get_clean(); return PheryResponse::factory('#result') ->html($data) ->jquery('body') ->css(array('backgroundColor' => 'red')) ->alert('This is an alert') ->script('window.setTimeout(function(){ $.callRemote("alias-for-function", {"new":"data","on":["the","block"]]}); }, 1500);') ->call('javascript_function', 'arg1', 'arg2', 3, array(1,2,3)) ->this() ->height(100) ->width(100) ->getJSON('http://jsonurl', PheryFunction::factory(array( 'function(data){', 'console.log(data);', '}' ))); } )) ->process(); 
+1
source

I am the author of KSS-RPC , a complete overhaul of an old KSS project .

Summary:

KSS (Kinetic Style Sheets) is a framework that allows you to create Ajax without writing more JavaScript. It uses stylesheets with CSS-compatible syntax to declare client behavior and to set well-defined DOM-like commands that are sent back from the server to manipulate the HTML page.

Features:

  • Supported protocols: JSON-RPC, XML-RPC, and URL-encoded requests
  • Supports all modern browsers, including IE9 + (IE8 with poly-regiments)
  • Independent of any third-party JavaScript library
  • Additional supported selection mechanisms: Sizzle (jQuery) and Slick (MooTools)
  • Supported animation libraries: Velocity, GreenSock, jQuery, and MooTools
+1
source

The Xajax library has been forked. The Jaxon library provides the same features as Xajax, and many others, such as exporting directories, namespace support, and startup.

0
source

Source: https://habr.com/ru/post/1299229/


All Articles