Two Js files in JQuery

I have the following js files in my code for EditInPlace ...

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

      

They both work well. But now I need to have a calendar in my application. So I have another js file

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

      

It works correctly. But now my EditInPlace is not working.

Why don't we have two js files in the application? I even tried to have the other two js protoype files, scriptacuolous and both worked well. But if I include any jquery, the scripts that match the prototype don't work.

0


a source to share


1 answer


jquery-ui-1.7.1.custom.min.js is the regular mini version you downloaded, and it contains more stuff than you need - it might even contain jQuery itself.

I recommend that you download only the required javascript file (UI core and UI Date Picker). Do not download packaged or smaller versions. Download full versions and then bundle all your javascript files and package them / yourself. It's easy with YUI compressor . For debugging purposes, it is much easier to work with 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 rarely happens with well-designed libraries like the ones you use. However, to identify the problem, you only need to include the files you need.

+2


a source







All Articles