Conflict with two javascript files

I am new to javascript, so I am trying to use two jQuery plugins and they are not working properly. Just if I remove one of the two.

How can I solve this problem? I could insert both .js files, but these are 2k lines of code, I don’t want to bother you with so many lines of code.

Or, if you know some kind of plugin that performs some functions, also help =)

- UPDATE:

Thank you guys (I can’t add a comment to my answers (I really don’t know why), some problems with the site.) @ Mörre I noted when I delete this line in AJS.js, it works (part of it):

AJS.exportToGlobalScope ();

But after that I don’t know what to do, sorry guys, I am new to javascript, there are so many things that you said, I don’t understand.

@Jim, I do not find:

  $ (document) .ready (function () {});

replace jQuery as you said.

I am trying to replace all '$' with 'jQuery' and still does not work.

+3
source share
2 answers

Walter

You may find that there is a collision with the alias $. you can make it work if you are referencing an object jqueryusing full jquery aliasie, rather than:

<script type="text/javascript">
    $(document).ready(function() {

    });
</script>

to try:

<script type="text/javascript">
    jQuery(document).ready(function() {

    });
</script>

change any references $to jqueryin the client code when using autocomplete lib.

just a thought if it is in relation to this 'area'

+3
source

, AJS AJS, . . - jQuery. : AJS ( AJS, "AJS".).

+2

Source: https://habr.com/ru/post/1796489/


All Articles