MCPcopy Index your code
hub / github.com/SuperMap/iClient-JavaScript / getCommonScriptPath

Function getCommonScriptPath

examples/js/common.js:97–111  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

95 }
96
97 function getCommonScriptPath() {
98 var r = new RegExp("(^|(.*?\\/))(common\.js)(\\?|$)"),
99 s = document.getElementsByTagName('script'), relativePath;
100 for (var i = 0; i < s.length; i++) {
101 var src = s[i].getAttribute('src');
102 if (src) {
103 var m = src.match(r);
104 if (m) {
105 relativePath = m[1] ? m[1].replace("js/", "") : "./";
106 break;
107 }
108 }
109 }
110 return relativePath;
111 }

Callers 1

common.jsFile · 0.85

Calls 1

matchMethod · 0.80

Tested by

no test coverage detected