views:

87

answers:

1

Hi,

I m having the following js files in my code for EditInPlace...

    <?php echo $javascript->link('jquery.js');?>
    <?php echo $javascript->link('jquery.editinplace.packed.js');?>

Both these are working good. But i now need to have a calendar in my app..So i have a another js file

    <?php echo $javascript->link('jquery-ui-1.7.1.custom.min.js');?>

..Its working correctly..But now my EditInPlace not working..

Wont we can't have two js files in the app.. Even i tried having other two js files protoype,scriptacuolous ..Both works good..But if i include any jquery Tat scripts corresponding to prototype not works... Please suggest me.....

+1  A: 

jquery-ui-1.7.1.custom.min.js is a custom minified version you've downloaded and it contains more things than you need - it could even contain the jQuery itself again.

I recommend that you download only the javascript file that you need (UI core and UI Date Picker). Do not download the packed or minified versions. Download the full versions and then concatenate all your javascript files and pack/minify them yourself. This is dead easy with YUI compressor. For debugging, it is much easier to work with the full versions.

To get back to your question, it is perfectly legal to have two or more javascript files, as long as there is no conflict between them. This is rarely the case with well designed libraries, like the ones you are using. To spot the problem however, you need to include only the necessary files.

kgiannakakis
also check the order of the js-files.It might be so that the one file needs things from the other, but can't find them because they're in the wrong order.You always need to reference jQuery first, and then jQuery-UI and your plugins.
Natrium