close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

using more than 1 javascript library

Thread began 6/11/2009 6:08 am by CraigR | Last modified 6/28/2009 10:02 am by CraigR | 7113 views | 10 replies |

CraigRBeta Tester

using more than 1 javascript library

i am playing with various javascript tools, such as slideshows and carousels and which invariably use different libraries, such as mootols, jquery and yui.

I presume it's not a particularly good idea to mix & match, but wonder if its possible to use 2 different libraries on the same page.

I'm currently developing my site, and have a header which is based on slideshow 2, (mootools) which loops through a series of still images to give me (imho) a nice effect.

www.stonepits.com

I am currently looking at javascript carousels, ideally for one where i can have text and images, which provide links to external content.
After playing with jcarousel for a couple of days, i think the yui carousel is more powerful, and have got something working, (not finished, but working)
The problem is that i cant get both to work on the same page.

yuicarousel.php

Is it a case of loading the libraries in the correct order, or is the problem more fuindamental ?

If i am hitting a wall, can someone please recommend a good yui based tool to act like slideshow ?

regards

Sign in to reply to this post

Justin Nemeth

It really depends on how the framework is implemented. Most javascript frameworks extend the built in JavaScript functions, so that is why you are likely getting conflicts. For instance, many frameworks have a $() function to get a quick reference, but if mootools and yui have that, it will cause errors since both are trying to declare the function and presumably doing it separate ways.

So, my general recommendation would be to stick with a single framework since that will always work.

I don't have any recommendtions for a yui slideshow since I primarily use mootools myself. Hopefully someone else has more experience there.

Sign in to reply to this post

CraigRBeta Tester

Thanks Justin.

Just to confuse matters more, i noticed that with both js libraries, IE7 works fine, (!), but in FF the carousel will not work.

Removing the mootools libraries from the page and the carousel is fine.

Sign in to reply to this post

Justin Nemeth

I would recommend installing Firebug for Firefox, its a free add-on. You can them see what javascript errors are occurring. I am not sure why it would work in IE7 and not in FF, but Firebug should help you track it down.

Sign in to reply to this post

CraigRBeta Tester

error

i ran firebug and got the following error.

can you help me decipher it ?

uncaught exception: [Exception... "Component returned failure code: 0x80004003 (NS_ERROR_INVALID_POINTER) [nsIDOMHTMLDivElement.insertBefore]" nsresult: "0x80004003 (NS_ERROR_INVALID_POINTER)" location: "JS frame :: element-min.js :: anonymous :: line 7" data: no]

Further to the above, I found a nice little javascript 'conveyor belt' which is really nice and simple, and gives me another option.

It populates the scrolling element by means of a javascript array.

I have linked my test page to a recordset and can use this recordset to populate a javascript array using php.

conveyorbelt.php

Sign in to reply to this post

Justin Nemeth

Not really sure about that error, but it seems to point to the inner workings of the YUI files. You could double check you have the most recent YUI files, but beyond that you probably have to look around to see if anyone else has encountered a similar error.

Sign in to reply to this post

CraigRBeta Tester

never mind

Thanks for your help.

I think i'll stick with my simple alternative for now until I get a bit more experience of other tools.

Sign in to reply to this post

CraigRBeta Tester

loading issue

i created a page with a newsticker and an image conveyor, and on my local server everything is fine.

when published to my isp, the page (usually) only loads the news ticker, until I refresh the page when the whole page loads.

newsticker.php

Sign in to reply to this post

CraigRBeta Tester

sorted.

never mind, problem resolved.

Sign in to reply to this post

Justin Nemeth

Hey Craig, I noticed this post over on the mootools blog. They have implemented a 'dollar safe mode' that should help cut down the conflicts with other frameworks. I still would recommend sticking to one framework, but this update might help if you have to use 2.

the-dollar-safe-mode/

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...