Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-4092

Improve wicket-ajax.js processScript method to not use XMLHttpRequest for loading <script src="">

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5.1
    • 1.5.2
    • wicket
    • None

    Description

      See http://markmail.org/thread/s25ryqyqvdq6xuzj for the whole discussion.

      In short: Ajax response contains <header-contribution><script src="http://some.other.domain/file.js"></script></header-contribution>. In wicket-ajax.js #processScript() method (~ line 1680) Wicket uses Wicket.Ajax.Request to load that file and then append it to <head> as <script> with text body instead of <script> with src attribute.

      If the src location is not in the same domain as the current app then XMLHttpRequest sends OPTIONS request and if the remote server is not configured to allow cross origin requests then the request for that resource is silently ignored.

      We need to investigate whether this can be improved by adding <script src="..."> directly to the <head> and leave the browser to load the content.

      Attachments

        Issue Links

          Activity

            People

              mgrigorov Martin Tzvetanov Grigorov
              mgrigorov Martin Tzvetanov Grigorov
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: