We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 30491
    • 44 Posts
    Hi,

    any one know a clean or dirty way to allow XML modx-resources to have the allow (access control allow origin)header?

    in php the line is as simple as this, however, I don’t know where I would insert it, and i’ve tried rummaging around modx but couldn’t really spot the necessary document...

    header(’Access-Control-Allow-Origin: *’);

    anyone have an idea?

    Using Mox Revolution, latest version of PHP and Nginx server..
    thanks
      • 6228
      • 249 Posts
      You can always just include a snippet with the php function

      [tt]header(’Access-Control-Allow-Origin: *’);[/tt]

      It should work, as long as nothing is output to the browser prior to the snippet call (including empty spaces!).
        lo9on.com

        MODx Evolution/Revolution | Remote Desktop Training | Development