jQuery and Global.js conflict
Baidu and Google many times, according to most of the online recommendations and their own testing,
SolveThe approach is as follows:Remove 10-13 lines of global.js or global.js file masking
Object.prototype.extend = function (object)
//{
Return Object.extend.apply (this, [this, Object]);
//}
And hope that people on the official website can explain the actual use of the Global.js file, the above solution affects the platform does not
Add the following code to the last side of the HTML file:
?
1234567 |
<script type= "text/javascript" src= "jquery-1.7.2.min.js" ></script> <script type= "text/javascript" > $( function () { window.__Object_toJSONString = Object.prototype.toJSONString; delete Object.prototype.toJSONString; }); </script> |
The order of the code in the file:
Import the Transport.js file first
?
1 |
{insert_scripts files="../js/transport.js,../js/region.js"} |
Then import the jquery file
?
1 |
< script type = "text/javascript" src = "jquery-1.7.2.min.js" ></ script > |
Plus this piece of code
?
123456 |
<script type= "text/javascript" > $( function () { window.__Object_toJSONString = Object.prototype.toJSONString; delete Object.prototype.toJSONString; }); </script> |
Finally, I introduce my own JS file written in jquery:
?
1 |
< script type = "text/javascript" src = "main.js" ></ script > |
Solutions to conflicts between Transport.js and jquery in Ecshop