crossOrigin property

Specifies whether to use Cross-Origin Resource Sharing (CORS) when fetching an image from a site outside the webpage's domain.

This property is read/write.

IE11

 

Syntax

JavaScript
object.crossOrigin = useCORS
useCORS = object.crossOrigin

 

Property values

Type: DOMString

One of the following:

ValueCondition
anonymous

Don't use CORS to request an image from another domain.

use-credentials

Use CORS to request an image from another domain.

 

Remarks

Cross-Origin Resource Sharing (CORS) is described in the W3C Cross-Origin Resource Sharing specification.

See also

HTMLImageElement

 

 

Show:
© 2014 Microsoft