Access Joomla view variable using jquery

I need to set a view filter based on user input (check / uncheck). There is no guarantee that the user will switch pages or send anything before this information is needed in the filter, so this must be done during input. Is there a way to access and change a variable in jquery?

+4
source share
2 answers

If you want to change server variables while on the client side using jQuery, AJAX (AJAX = Asynchronous JavaScript and XML) is your remaining user.

AJAX is not a new programming language, but a new way to use existing standards. AJAX is the art of exchanging data with the server and updating parts of a web page without reloading the entire page.

Refer jQuery API

More details for AJAX callback.

+1
source

This similar question or just might help your problem show how to get GET and POST page data.

How to get GET and POST variables using jQuery?

Otherwise, sending data to the server without sending or loading the page is possible using jQuery.ajax()

So you make a call like: jQuery.ajax('somewebpage.php?someVariable=someValue&someOtherVariable=someOtherValue');

and in a PHP file, you store this data in a session or database. And on the next page, download this data.

0
source

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


All Articles