We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30562
    • 99 Posts
    In more details:
    Usage own "alert" also may be other JS-functions (substitution of standard JS-function).

    It would be desirable, that standard dialogues of type "alert" in a client browser, would be in uniform style with all site.
    I, like, have localised such place regarding authorisation of users. It is function "webLoginAlert" in ...\assets\snippets\weblogin\weblogin.common.inc.php.

        // show javascript alert    
        function webLoginAlert($msg){
            return "<script>window.setTimeout(\"alert('".addslashes(mysql_escape_string($msg))."')\",10);</script>";



    It can be substituted on own JS-function.


    Somebody used such method?

    Perhaps, developers of MODX have already thought up for a long time something about such substitutions?
      • 33372
      • 1,611 Posts
      If you check out jQuery, mootools, or other popular JavaScript libraries you can find such functions. MODx currently uses mootools by default (for Manager features and bundled resources like QuickEdit and AjaxSearch), but you can use whatever library you prefer (personally I’m a fan of jQuery). In general, the MODx developers don’t make many (if any) decisions about what your sites should look like or include or how they should be coded; they try to give you the freedom to do whatever you want.
        "Things are not what they appear to be; nor are they otherwise." - Buddha

        "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

        Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
        • 30562
        • 99 Posts
        Thanks.