Rating: 5 stars
Excelent!
]]>Rating: 5 stars
I found this plugin to be very exasperating, because the only documentation it has is how to install it. There is NOTHING on how to actually use it. One BIG thumb down.
]]>Rating: 5 stars
Very elegant solution. Working with a lot of ajax was pretty boring, but now it’s not.
Thank you!
Rating: 5 stars
I found this plugin when I was trying to develop ajax content update with built in wordpress tools.
Mostly syntax is pretty straightforward and self explanatory.
Tricky part is when you need to pass variables back to page.
Luckily plugin developer appeared very nice person and pointed me how to use plugin nice and easy.
Now here’s the trick:
Say, we want send two variables to php side, process that data and show alert only for birds.
Note: you can change “myaction” to whatever you like.
On html side we embed javaScript:
jxAction('myaction', {'variable_name': 'apples','another_variable': 'penguins'}, function(v){
alert(v['birds']);
});
On php side in functions.php we add action hook:
add_action('jx_myaction', function($jx){
$data = $jx->data; //this is array with our variables
$bird = 'penguins';
foreach ( $data as current_var ) {
// here we write desired values to array that will be returned.
if ( $current_var == $bird ) $jx->variable('birds', $fname);
}
});
That’s pretty much it.
p.s. IMPORTANT! In case of error on php side, you might get “Wrong jx JSON response (not JSON)” message. Then you should check webserver logs for errors.
My recommendations, five stars.
]]>Rating: 5 stars
Putting “interface part” out of your mind, you can always concentrate on the logic itself. It is increasing programming productivity and lower human errors.
]]>