Joomla-Ajax-Interface/component

Need "Hello World!" example

Closed this issue · 6 comments

Hi! I'm trying to add a simple ajax call to a page in my Joomla 1.5 site, and I thought that "Hello World!" example could help in understanding how to use com_ajax. Could you make such example for beginners?

I added following HTML to the Joomla page:
Enter name:   Click!

I need to understand how can I call com_ajax and update "statDiv" with the entered name. I was also thinking about using Sourcerer to embed php into the page.

Thank you!

Hello! Can you explain more about how you are trying to use com_ajax? To be sure, com_ajax is intended to be used with plugins and modules. Are you developing a plugin or module to use on this page? I will see if I can put together a simple Hello World Ajax module.

Thank you for the quick answer! I want to implement a product activation via web site. The product is distributed along with a Windows application - "Activator", that can generate a text request and accept text response. This is needed for product activation in DMZ (no Internet). I want a customer to go to my Joomla web site, enter the activation request, click button, obtain text response on the web page, and carry it to DMZ on a flash drive. I'm not a Joomla expert, so I do not know should I develop custom module, or just use HTML with embedded Ajax call. Btw, Php/Cgi module that generates the response for a given request is available.

Would you recommend developing a module for the purpose? Thank you!

I would say that it really depends on what features you need in the backend of your Joomla website. For example, if you need any sort of administrative interface, I'd recommend developing a simple component. If you are certain that you only need to generate these codes on the frontend, without any sort of administrative interface in the backend, a simple module should suffice. Basically, the hello world example that I created should get you started, with the hardest part likely being hooking into the Php/Cgi module.

Hope that helps!

Yes, this is very helpful! Thank you! I decided to proceed with my own component creation (first ever). I'll be calling Ajax via your com_ajax component. Many thanks again!

You're very welcome! If you are going to develop your own component, you won't need to use com_ajax as you can make ajax requests directly to the component. Glad it helps!