javascript Programming Glossary: getcurrentscriptelement
Is it the last `script` element the currently running script? http://stackoverflow.com/questions/14409982/is-it-the-last-script-element-the-currently-running-script in the same place. I'm doing something like this function getCurrentScriptElement var scripts document.getElementsByTagName 'script' return scripts.. 'script' return scripts scripts.length 1 var script getCurrentScriptElement var view document.createElement 'span' Put stuff in our view..... is in the body of the document is this safe Will the getCurrentScriptElement function always return the running script If not how can it..
Is `document.write` suitable for finding the element associated with the currently running script? http://stackoverflow.com/questions/14410748/is-document-write-suitable-for-finding-the-element-associated-with-the-current there any possible pitfalls I'm not thinking of function getCurrentScriptElement var placeholderId 'placeholder ' Math.random script placeholder.. . My previous attempt looked something like this function getCurrentScriptElement var scripts document.getElementsByTagName 'script' return scripts..
|