Monday, July 28, 2014

% D bloggers like this:


At times, the reader may have trouble bringing jQuery to share other scripts. Or even have some css framework to be embedded script inside the script is running, which can cause distortion of the picture should be. Today I will present a technique to solve such a problem, that is fine to use jQuery in no-conflict mode itself.
Let's look at the code examples and explanations on <script src="other_library.js"> </ script> <script src="jquery.js"> </ script> <script> / / Here we declare the variable $ j. Instead, the $ post var $ j = jQuery.noConflict (); $ j (document). ready (function () {$ j ("div"). hide ();}); / / the variable $ this means. variables from script other_library.js / / mainDiv francesco ferro so orders below $ ('main') means to call the function / / of other_library. Not calling the jquery function on window.onload = function () {var mainDiv = $ ('main');} </ script>.
See the code examples do <script src="other_library.js"> </ script> <script src="jquery.js"> </ script> <script> jQuery.noConflict (); jQuery (document). Ready. (function ($) {/ / use the $ this refers to the jQuery on (locally scope) $ ("div"). hide ();}); francesco ferro / / Using the variable $ this is meant to be. Using the global scope / / which means that I run $ of other_library window.onload francesco ferro = function () {var mainDiv = $ ('main');} </ script>.
If we include jQuery before, and if the script that follows the variable $ are considered variable $ is a script that declared the latter (override) If we want to use jQuery to do this by running the function jQuery. Frankly to me the example below </ pre> <script src="jquery.js"> </ script> <script src="other_library.js"> </ script> <script> / / call the jQuery listener. Full Function jQuery (document). ready (function () {jQuery ("div"). hide ();}); / / run $ variables specified in other_library.js window.onload = function () {var mainDiv = $. ('main');}; </ script> <pre>.

Notify me of follow-up comments via email.
Error: Twitter did not respond. Please wait a few minutes and refresh this page. Recent sampling the roulette wheel (roulette wheel selection) (Part 2) sampling the roulette wheel (roulette wheel selection). (Part 1) Create a new user with cygwin installed Secure Shell Server as a windows service (windows 7) on Cygwin apt-cyg install a package manager for cygwin.
algorithm alogrithm android apt-file apt-get atomic build C codeIgniter critical css CUDA CUDA 3.0 cygwin disk div english francesco ferro ex firefox fortune ga galib HPC installation integration jargon francesco ferro java javascript jQuery link linux love matrix matrix multiplication monte carlo monte carlo method mount music netbeans network francesco ferro NVIDIA. driver OpenMP oscar php pi pmount popen programming race condition ram ramdisk random roulette wheel route sed shell script shinji tamimura system time timer tweet ubuntu ubuntu 10.0 vim wc words of the day Blog Stats 37,458 hits Archive May 2014 (7) January 2014 (1). June 2013 (1) April 2013 (1) 2013 (2) November 2012 (1) August 2012 (3) July 2012 (1) June 2012 (10) May 2012 (1) February 2012 (2) January 2012 (5). December 2011 (3) November 2011 (1) October 2011 (2) September 2011 (4) August 2011 (9) July 2011 (8) June 2011 (6) March 2011 (1) February 2011 (3) January 2011 (3). December 2010 (1) 2010 (1) October 2010 (7) September 2010 (5) June 2010 (1) Interesting Places BBC learning My thesis blog Online LateX Equation Editor SIG Cluster Soowoi's francesco ferro Tip Ubuntu Club.
% D bloggers like this:

MORE



No comments:

Post a Comment