I did heavy use of jquery on my php project. But on some page the $
is not working, so I have to use jquery. For example:
jQuery(\'#mycarousel\'
$
is an alias of jQuery in old version.
In latest version if you're using this $
then that function will not execute.
So, no need to change the entire code with jQuery...
before that code, put:
var $ = jQuery;
very simple...
It's a jquery conflict. You should use a correct jquery plugin to solve this problem. use a latest Jquery plugin and remove the old one from your code.
when .noConflict()
is called, selector like $('')
is no longer working to ensure compatibility with other framework such as Prototype. at that time jQuery('')
is used instead.
Reference: jQuery.noConflict()
To better illustrate the idea, here is an example obtained from the reference link:
<script type="text/javascript">
$.noConflict();
jQuery(document).ready(function($) {
// Code that uses jQuery's $ can follow here.
});
// Code that uses other library's $ can follow here.
</script>
these are same except $ is ShortForm of Jquery in Jquery
$.ajax({
url: 'Emp.asmx/getDesignation',
type:'post',
contentType: 'application/json;charset=utf-8',
dataType: 'json',
data: "{}",
aync: false,
$
is just a variable that is used to alias jQuery
and it is a varible so anything could be assigned to it.
You can get detailed information related to it from its Documentation