From 074785cea106179cb3305637055ab0a009ca74f2 Mon Sep 17 00:00:00 2001 From: Peter Bengtsson Date: Tue, 8 Dec 2020 14:42:52 -0500 Subject: initial commit --- files/nl/web/api/document/currentscript/index.html | 117 +++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 files/nl/web/api/document/currentscript/index.html (limited to 'files/nl/web/api/document/currentscript/index.html') diff --git a/files/nl/web/api/document/currentscript/index.html b/files/nl/web/api/document/currentscript/index.html new file mode 100644 index 0000000000..fd86f2f38e --- /dev/null +++ b/files/nl/web/api/document/currentscript/index.html @@ -0,0 +1,117 @@ +--- +title: Document.currentScript +slug: Web/API/Document/currentScript +tags: + - API + - DOM + - Property + - Reference +translation_of: Web/API/Document/currentScript +--- +
{{ApiRef("DOM")}}
+ +

Geeft het {{HTMLElement("script")}} element wiens script op dit moment wordt uitgevoerd.

+ +

Syntax

+ +
var curScriptElement = document.currentScript;
+
+ +

Voorbeeld

+ +

Dit voorbeeld controleert of het script asynchroon wordt uitgevoerd:

+ +
if (document.currentScript.async) {
+  console.log("Wordt asynchroon uitgevoerd");
+} else {
+  console.log("Wordt synchroon uitgevoerd");
+}
+ +

View Live Examples

+ +

Opmerkingen

+ +

Het is belangrijk om te weten dat dit geen referentie naar het script-element geeft als de code in het script wordt aangeroepen als een callback of event handler; het refereert alleen naar het element wanneer dit initieel wordt verwerkt.

+ +

Specificaties

+ + + + + + + + + + + + + + + + +
SpecificationStatusComment
{{SpecName("HTML WHATWG", "dom.html#dom-document-currentscript", "Document.currentScript")}}{{Spec2("HTML WHATWG")}}Initiƫle definitie
+ +

Browser compatibiliteit

+ +

{{CompatibilityTable}}

+ +
+ + + + + + + + + + + + + + + + + + + + + +
FeatureChromeEdgeFirefox (Gecko)Internet ExplorerOperaSafari
Basisondersteuning{{CompatChrome(29.0)}}{{CompatVersionUnknown}}{{CompatGeckoDesktop("2.0")}}{{CompatNo}}168
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + +
FeatureAndroidChrome for AndroidEdgeFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basisondersteuning4.4{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatUnknown}}{{CompatUnknown}}8
+
+ +

Zie ook

+ + -- cgit v1.2.3-54-g00ecf