We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 10208 ☆ A M B ☆
    • 1,780 Posts
    OK, gotcha. I don't speak javascript, it's still witchcraft and evil trickery to me.

    It's a class then, correct?
      Frogabog- MODX Websites in Portland Oregon
      "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
      Having server issues? These guys have MODX Hosting perfected - SkyToaster
      • 36467
      • 73 Posts
      Quote from: frogabog at Dec 23, 2012, 11:31 PM
      OK, gotcha. I don't speak javascript, it's still witchcraft and evil trickery to me.
      It's a class then, correct?
      Its not a class. whatever the server page echo's, ajax/js function "success" at client side catches it and stores all the returned data in variable, in our case its storing (json) data in "responce" variable, which we can use as a js variable which can be whatever you want.
      success: function(responce){
        alert(responce);
      }


      javascript isnt witchcraft at all smiley You must start learning it and best way is to use jquery framework. It makes it too easier to learn javascript. I dont know how to code in plain javascript but i can code well using jquery. [ed. note: amitpatil last edited this post 13 years, 9 months ago.]
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Indeed, I used to code raw XMLHttpRequest functions (AJAX) before it was given the name AJAX, and I still frequently feel as you do; it's definitely evil trickery. That "this" business, for example. "this" what? You can never quite be sure what it means. Working with JQuery makes life so much easier. Usually I can get even complex JQuery plugins to work reasonably quickly, sometimes on the first try.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 36467
          • 73 Posts
          If you used to code raw XMLHttpRequest then i must say you are old player of javascript. I started learning jquery only 2-3 years back. You just need "start" and you will be "done".
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            Yes, I've been doing Javascript for somewhere around 15 years, and I still hate it. I'd rather wash dishes or change dirty diapers. Finding myself having to actually work with Javascript code, as opposed to implementing a JQuery plugin, will often remind me that I need to go scrub a bathroom or something - anything!
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 36467
              • 73 Posts
              :D LOL You are really criticizing javascript by comparing it to the diapers changing.
                • 36924 ☆ A M B ☆
                • 298 Posts
                @Frogabog: where you able to get this to work?

                @www.amitpatil.me: how possible to set a duration for the user's registration.

                  • 10208 ☆ A M B ☆
                  • 1,780 Posts
                  Sorry, never tried. I was just dabbling in the conversation. Seems amilatil.me got it going though.
                    Frogabog- MODX Websites in Portland Oregon
                    "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
                    Having server issues? These guys have MODX Hosting perfected - SkyToaster
                    • 36924 ☆ A M B ☆
                    • 298 Posts
                    Thanks. It's something I will require very soon.

                    @www.amitpatil.me: by duration I mean, possible to set, say a six months duration where after six months the user is blocked probably becuase their activity on the site expected to not go beyond six months (from the date of first login)