I have a page that grabs these two files dynamically.
Now Skype has following line:
s.trackAction(_t, this);
Unfortunately the tracking tool JavaScript file also has s as an objects and due to which s.trackAction
is not valid for Skype and breaks the whole page.
You could do the following:
s
to a variable, let's say first_s
. s
to a variable, let's say second_s
. Then, set s
to whichever of these that you want to be the default global value (eg for other people's code).
Then, for your own code or any other code you are using, put it inside this type of block:
(function(s) {
// any code in here that refers to `s` will see the value of second_s
})(second_s);
or
(function(s) {
// any code in here that refers to `s` will see the value of first_s
})(first_s);
Another option I can think of is to modify the Skype code to use a global variable named skype
instead of s
and include that modified version in your page.
If the skype code was written properly, it would have an ability to NOT use a simple globally defined name like s
. jQuery and others who use the $
symbol have shown everyone how to do this properly.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.