Skip to content
This repository was archived by the owner on Apr 16, 2019. It is now read-only.
This repository was archived by the owner on Apr 16, 2019. It is now read-only.

CANNOT get a cross-domain script via $.ajax({ type: 'script'}). #607

Closed

Description

@LeoYuan

bug description

you will get an cross-domain error when using $.ajax({type: 'script'}) to get script, 'cause the code always create a XHR object to send requests.

how to reproduce?

af.ajax({
      url: 'https://ehr.alibaba-inc.com/assets/masterdata/employee/lib/lodash.min.js',
      dataType: 'script',
      success: function() {
             console.log('loaded');
      }
})

how to fix?

create a script tag to load script.

Activity

  1. lenichols commented on Nov 5, 2014

    @lenichols

    dealing with this same issue...

  2. imaffett commented on Nov 5, 2014

    @imaffett
    Contributor

    @lenichols Saying "I'm dealing with this same issue" isn't helpful"

    It should work though. There is a shorthand helper that just wraps around it

    https://github.com/01org/appframework/blob/master/appframework.js#L1973

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions