Skip to content

Ajax: preventing xss on untrusted URLs #732

@timmywil

Description

@timmywil

Per jquery/jquery#2175, I recommend we add a note on the ajax page about retrieving scripts from an untrusted domain. Automatic JS execution and JSONP type inference can be prevented with options. All that is required is to set the dataType...

$.get({
  url: "//untrusted.com/script.js",
  dataType: "text"
});

http://jsbin.com/rafima/1/edit?js,console

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