-
☆ A M B ☆
- 894 Posts
@Bruno I'm sure it might be possible but that might break the form page if the user has JS disabled it's a tricky situation and this discussion is giving me ideas on other things to try so thank you all for the suggestions
but that might break the form page if the user has JS disabled
Not at all. You can still use the normal Form-submission, if js disabled.
-
☆ A M B ☆
- 24,524 Posts
That leads to a design philosophy called "unobtrusive Javascript". Your buttons should work as usual by loading a new page, and the Javascript disables that normal functionality and triggers the Javascript behavior instead.
http://alistapart.com/article/behavioralseparation
-
☆ A M B ☆
- 24,524 Posts
With the help of JQuery, AJAX is actually kind of fun. There's also this
https://forums.modx.com/thread/79187/support-comments-for-ajax-revolution but I haven't been able to take the time to really get a good understanding of exactly what it's doing. I do know that it's pretty neat if you're doing a site heavy on the AJAX.
Hi! I am amazed. It's working now. Thanks again for your support.
-
☆ A M B ☆
- 3,112 Posts
Quote from: sottwell at May 02, 2013, 03:27 AMActually it's very easy to implement AJAX in MODx.
1. Create a snippet to generate whatever output you want to load with your AJAX request, if you need back-end PHP processing. It goes on a resource with no template. Or, if you're using JQuery's load() function, have the desired output in a specific HTML element; the load() function takes a parameter to indicate which HTML element you want to insert. So you can use one resource to handle a number of AJAX requests.
2. Use that resource's URL as the AJAX request's URL.
That's all, as far as MODx is concerned. Creating the triggers and setting up the structure is up to the developer.
I found that it's no longer required to use resource as the proxy in MODX Revo.
http://www.virtudraft.com/blog/ajaxs-connector-file-using-modxs-main-index.php.html
Rico
Genius is one percent inspiration and ninety-nine percent perspiration.
Thomas A. Edison
MODx is great, but knowing how to use it well makes it perfect!
www.virtudraft.com
Security, security, security! |
Indonesian MODx Forum |
MODx Revo's cheatsheets |
MODx Evo's cheatsheets
Author of
Easy 2 Gallery 1.4.x,
PHPTidy,
spieFeed,
FileDownload R,
Upload To Users CMP,
Inherit Template TV,
LexRating,
ExerPlan,
Lingua,
virtuNewsletter,
Grid Class Key,
SmartTag,
prevNext
Maintainter/contributor of
Babel
Because it's hard to follow all topics on the forum, PING ME ON TWITTER
@_goldsky if you need my help.