ReferenceError when getting .src with script element in different domain #6

lessmind opened this Issue Feb 14, 2012 · 0 comments

1 participant


Hi, this issue happend when there's some script source not in the same domain.
Like now I'm in, but the script is at, and when I access its src like


Then I got errors here.

Actually they are all in the same block, so I post these together.

                var pos = S.lastIndexOf(match[4], ":");
ReferenceError: S is not defined

       = substring(match[4], 0, pos);
ReferenceError: substring is not defined

                this.port = substring(match[4], pos+1);
ReferenceError: substring is not defined

Maybe there should be some utilities been required in this module, but I can't find it though, now I modified it, and not sure if I made any other mistakes. Hope I can have some solutions here.

The original:

    var pos = S.lastIndexOf(match[4], ":"); = substring(match[4], 0, pos);
    this.port = substring(match[4], pos+1);


    var pos = match[4].lastIndexOf(':'); = match[4].substring(0, pos);
    this.port = match[4].substring(pos+1);
@fgnass fgnass added a commit that referenced this issue Feb 14, 2012
@fgnass Fixed issue #6 becf66a
@lessmind lessmind closed this Feb 17, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment