HasCrossorigin
API reference › HTML Attribute › HasCrossorigin
Used by 5 types
Provides an immutable API for the crossorigin attribute.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Attributes/crossorigin.
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
crossorigin() | Sets the crossorigin attribute. | HasCrossorigin |
Method details
Section titled “Method details”crossorigin()
Section titled “crossorigin() ”public function crossorigin(string|UnitEnum|null $value): staticSets the crossorigin attribute.
Controls credentialed requests for cross-origin resources.
Parameters
| Parameter | Type | Description |
|---|---|---|
$value | string|UnitEnum| | CORS mode token, or null to remove the attribute. |
Returns
static: New instance with the updated crossorigin attribute. Crossorigin for predefined enum values.
Throws
InvalidArgumentException: If the value is not valid.