I created a flash application, which can call JS function with the required parameters. I need that this JS code posted a comment with passed parameters on the same page where my app is located.
For example Jot. How do I send Jot comment from JS function?
-
☆ A M B ☆
- 24,524 Posts
Use AJAX. I haven't used Jot as an AJAX processor although eForm works quite well, but since all Jot comments are in the database a custom PHP application could be used a the AJAX procesor to fetch what is desired from the database. Personally, I think that Flash -> Javascript -> PHP is a little convoluted; usually you can use Javascript alone to do just about anything on the client side that you might be using the Flash for; there is probably at least one JQuery plugin to do whatever your Flash is doing.
hi,
Susan's answer is the answer, use Ajax... the "only" way to have front and serverside communicating with js
actually you'll simply have to call, with ajax, a page that contains a function, the jot native one or yours, that feeds the jot table.
Don't forget to pass your user internalKey and a ressource id as params, it will help you sort and display the comments afterwards
something, i haven't understood, is your form in your flash app too ? if yes, flash doesn't need js to send things the async way to ths server, all you need is to call a php page sending the infos the same way any flash form would do it
have swing
réfléchir avant d'agir
hi,
well, honestly, now that i understand a bit more what you're trying to do, i would say "why use jot?"
actually, the easiest way to do this would be to set a table of your own e.g. yourprefix_score with at least those two fields: id_user (or internalKey if you want to keep modx internal logic) and score, why not a date/timestamp to get a user progression and feed this table with a snippet of your own two (the smartest way being of course using ajax to do this
jot has a complex structure you don't need to achieve what you're looking for
have swing
réfléchir avant d'agir