• About
  • Advertise
  • Privacy & Policy
  • Contact
djavupixel.com
  • Home
  • Design
    • Fonts
    • Icons
    • Logo
    • Photography
    • Wallpapers
  • Development
    • CSS
    • JS
    • Web
  • WordPress
  • Contact
No Result
View All Result
  • Home
  • Design
    • Fonts
    • Icons
    • Logo
    • Photography
    • Wallpapers
  • Development
    • CSS
    • JS
    • Web
  • WordPress
  • Contact
No Result
View All Result
djavupixel.com
No Result
View All Result
Home Development JS

Error: $ is not a function or how to resolve conflicts with other javascript libraries that use $() function

djavupixel by djavupixel
September 3, 2010
in JS
180
0
563
SHARES
1.8k
VIEWS
Share on FacebookShare on Twitter

One of the reasons that make a jQuery popular is its extensions and plugins. Some CMS also include the jQuery library such as WordPress.

Plugins let easily add functionality to a website and sometimes one might include more than one JavaScript Libraries (Prototype, jQuery, Mootools, etc).  If you have more than one library it might brake the behavior of the first one.

When you use the function jQuery.noConflict() it will return $() to it’s previous owner and you will need to use jQuery() instead of shorthand $() function.

jQuery.noConflict();
jQuery(document).ready(function(){
jQuery("#someid").hide();
});
// Now you can use Prototype or other libraries with $(...)
$('someid').hide();

Tip: you can shorten this by assigning jQuery to a variable name. Example: var $j = jQuery;

Another case is when  you have a bunch of javascript/jQuery code (small scripts or plugins) that’s already written to use the $, and you don’t want to search and replace the $ with jQuery.

jQuery(document).ready(function($){
// Inside this block you use the $ of jQuery
// not the other $
});
Tags: CodingJavaScriptjQuery
Next Post

Rules to design and to provide a compelling message for your landing page

Next Post
Rules to design and to provide a compelling message for your landing page

Rules to design and to provide a compelling message for your landing page

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • CSS
  • Design
  • Development
  • Fonts
  • Icons
  • JS
  • Logo
  • MacOS
  • Photography
  • Uncategorized
  • Wallpapers
  • Web
  • Wordpress

Tags

Air apple car Chrome city Coding communication Corporate Identity Cross Site Scriptings css Design e-Commerce Earth Extensions Free Google Gradient Styles grd Guideline Icons iPhone iPhone4 JavaScript jQuery Landscape Logo mac Nature Navigation osx Photography Photoshop php plugins PSD Sans-Serif security Serif setup SQL Injections Tutorial Water Wordpress WP e-Commerce xss
  • About
  • Advertise
  • Privacy & Policy
  • Contact

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Review
  • Apple
  • Applications
  • Computers
  • Gaming
  • Gear
    • Audio
    • Camera
    • Smartphone
  • Microsoft
  • Photography
  • Security

© 2023 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
This website uses cookies. By continuing to use this website you are giving consent to cookies being used. Visit our Privacy and Cookie Policy.