How to use jQuery with other javaScript Library?

When we make a web page,  sometimes we have to use 2 or more javascript library. Lots of library use $ as a identifier, so a way that prevent clashes is needed.

There is .noConflict() method which delegate identifier’s authority to other javascript library. For example,

<script src=”prototype.js” type=”text/javascript”></script?

<script src=”jquery.js” type=”text/javascript”></script>

<script type=”text/javascript”>

 jQuery.noConflict();

</script>

<script src=”myscript.js” type=”text/javascript”></script>

reference: Learning jQuery 1.3 Jonathan Chaffer, Karl Swedberg.

Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.