1.Can someone please help me with finding a good, powerful JS/Ajax library. I really like the look of MoTools, but can't find out how to use it. I was looking at something (I think it was drag and drop) and it said stuff about elements.js - only 1 js file was included in the download, and it wasn't elements.js. So if someone could give me instructions on proper download and setup, that would be appreciated. 2. How can I execute a PHP function() in a file from the Ajax? Cheers, BP
1.- You could use jQuery and it's library, jQuery UI. http://jquery.com http://ui.jquery.com/ It's easy to use, there are good tutorials on the wiki and many plugins that might already do what you want. 2.- What is usually done is to call a PHP file through AJAX, get the result and operate accordingly. Javascript is executed on the client side and PHP on the server side, so there isn't a way to make Javascript execute a PHP file by itself. You can read more at: http://docs.jquery.com/Ajax Hope that helps, Zeldinha
I can't use libraries...I just can't. I follow the tutorials exactly and they never work. So we'll pass by that. We'll go to number 2, and I'll try to explain in more detail: Say my PHP code is something like this: function test(){ //Some Code } PHP: What I want to do is execute test() - because I do not want to store the code in a PHP file that can be accessed by the user. I can use a few PHP workarounds to stop direct access to the file, but it would be a feature I'd like to be able to utilise in Ajax. Though if its not possible, not much I can do about it. Thanks for your help. BP
I use prototype for my ajax functions and overall it has some very nice functions. The only thing I don't like about it is that it's pretty large. It's over 100kb. It's not that big of a deal for me since my script is hosting videos and all visitors generally have fast connections. I couldn't any of the examples to work either. I finally had to pay someone to help me integrate ajax into my script. I wanted to use mootools but it wont allow you get xml just plain text. I couldn't figure it out any way.
Hey, try my KoolAjax, building for PHP. Pretty small in size Bellow example shows how easily that you can call a PHP function from client-side: http://www.koolphp.net/support/demos/#koolajax.example_function_callback_basic