summaryrefslogtreecommitdiffstats
path: root/o3d/samples/o3djs/util.js
diff options
context:
space:
mode:
Diffstat (limited to 'o3d/samples/o3djs/util.js')
-rw-r--r--o3d/samples/o3djs/util.js14
1 files changed, 13 insertions, 1 deletions
diff --git a/o3d/samples/o3djs/util.js b/o3d/samples/o3djs/util.js
index 16c0360..8a696c9 100644
--- a/o3d/samples/o3djs/util.js
+++ b/o3d/samples/o3djs/util.js
@@ -667,6 +667,17 @@ o3djs.util.isScriptUri = function(uri) {
};
/**
+ * Returns whether or not this is a script tag we want. Currently that is
+ * only script tags with an id that starts with "o3d".
+ * @private
+ * @param {!Element} scriptElement The script element to check.
+ * @return {boolean} True if we want this script tag.
+ */
+o3djs.util.isWantedScriptTag_ = function(scriptElement) {
+ return scriptElement.id && scriptElement.id.match(/^o3d/);
+};
+
+/**
* Concatenate the text of all the script tags in the document and invokes
* the callback when complete. This function is asynchronous if any of the
* script tags reference JavaScript through a URI.
@@ -680,7 +691,8 @@ o3djs.util.getScriptTagText_ = function() {
var scriptElement = scriptElements[i];
if (scriptElement.type === '' ||
scriptElement.type === 'text/javascript') {
- if ('text' in scriptElement && scriptElement.text) {
+ if ('text' in scriptElement && scriptElement.text &&
+ o3djs.util.isWantedScriptTag_(scriptElement)) {
scriptTagText += scriptElement.text;
}
if ('src' in scriptElement && scriptElement.src &&