We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32159
    • 15 Posts
    I tried setting up a simple jquery script to open all links in a new window, but it does not work.
    The page is here: http://madelynfaria.com/index.php?id=4
    I’m linking to the script from my template and the script is as follows:
    $(document).ready(function(){
    $(’a[href^="http"]’).attr("target", "_blank");
    });

    I have no problem getting this to work on a regular html page, but not working for some reason in modx.

    Any help would be appreciated.

    David
      • 13094
      • 58 Posts
      your template is missing the jQuery file itselves.
      while logged in, the quikeditor may deliver it, but when off it is missing.
      please use firebug to check that.

      cheers,
      rolf
        • 32159
        • 15 Posts
        Thank you very much. Yes, I had assumed the jquery library was already loaded because of the page source showing the call to the library due to the quick editor. Makes sense now. Thanks!
          • 13094
          • 58 Posts
          cheers, you’re welcome!