Create Custom Js file from Jquery Core file -
in project, 1 widget (embed site), there jquery conflict issue parent website.
so need create own js core file jquery core file. there way create custom js jquery core file.
i have used below script still same problem.
$.noconflict(); jquery(document).ready(function($) { // code uses jquery's $ can follow here. });
i have used few methods jquery core. want create own js file jquery core file.
use anonymous function so:
(function($) { //insert jquery }(jquery))
what allows use $
passes jquery
anonymous function. anonymous functions self-invoking, meaning automatically call when loaded.
if wanted include own javascript file, can utilize .getscript()
$.getscript(url, function() { //success stuff })
i don't believe work if script want on different domain hosted though. xss issues , not.
Comments
Post a Comment