Hello All, We are going to start new batch from next week. message/call or mail us for more details.

7 September 2013

JQuery noConflict method

In JQuery generally ($) dollar sign is an indication of using JQuery function but jQuery give us functionality to rename ($) dollar sign instead of other user define variable name. By using noConflict () method, user can define own variable name. In this article I am trying to show you, how we can use noConflict method in JQuery as shown below:

Syntax: var xyz=$.noConflict ();

Code:

    <title>JQuery noConflict method</title>
 
    <script type="text/javascript" src="jquery.min.js">     </script>
    <script type="text/javascript">
        var userdefine = $.noConflict();//creating user define varaible
        userdefine(document).ready(function() {
        userdefine("label").append("JQuery dollar($)sign has changed from user define variable name('userdefine'        });
    </script>
</head>
<body>
    <h2>
        JQuery noConfilct method</h2>
    <label>
    </label>
</body>
</html>

Screenshot

JQuery noConflict method

No comments:

Post a Comment