Referencing 2 Jquery Sources Conflict?

Referencing 2 Jquery Sources Conflict?

RavenRaven Posts: 28Questions: 0Answers: 0
edited January 2012 in Bug reports
I have Datatables folder with everything that should be in it to use. When i reference
[code]



[/code]
then it works. But now i wanna add animations to some of the things on my site for that i downloaded Jquery-17.1.js
and i call it like this:
[code]

[/code]
cause its in a different folder and its got all the fade in's fade out. problem is if i source refence my js and the datatable js

then not new cool repeater or my fade in fadeout wants to work?
This is for my repeater table... thank you its awesome.
[code]

$(document).ready(function () {
$('#tblMatters').dataTable({ "oLanguage": { "sSearch": "Search:" },
"iDisplayLength": 10,
"aaSorting": [[0, "asc"]]
});
});

[/code]
This is for my button animation
[code]
$(document).ready(function(){
$('#hideButton').click(function(){
$('#disclaimer').fadeOut();
});
});
[/code]

What should i do?
thank you in advance

Replies

  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    Only include jQuery once?! :-)

    Include your files like:

    [quote]
    jQuery
    DataTables
    other plug-ins
    [/quote]

    Allan
  • RavenRaven Posts: 28Questions: 0Answers: 0
    So if i added both then why would i get the following error:

    Microsoft JScript runtime error: Object doesn't support property or method 'dataTable'
    [code]




    <!--This is coding for the repeater -->

    $(document).ready(function () {
    $('#tblSearchCust').dataTable({ "oLanguage": { "sSearch": "Search:" },
    "iDisplayLength": 10,
    "aaSorting": [[0, "asc"]]
    });
    });
    $(document).ready(function () {
    $('#btnSubmit').click(function () {
    $('#tblSearchCust').fadeOut("slow");
    });
    });

    [/code]

    and this is my button and repeater:

    [code]










    Search Results






    DR No


    ect.......
    [/code]
    ID

    [/code]
  • RavenRaven Posts: 28Questions: 0Answers: 0
    i failed to mention. I get that error on the repeater table. Using datatable plugin, So when i remove the
    [code]

    [/code]

    Then my repeater works but then my fade in doesnt work
  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    I don't quite understand why you would want to include jQuery twice? :-)

    Just include it once - the version that shipped with DataTables 1.8.2 was jQuery 1.6.2. It could be that your fade needs 1.7.1? Just include that library rather than the jQuery version that DataTables shipped with. So the load order would be:

    jQuery 1.7.1
    DataTables
    other stuff

    Allan
  • RavenRaven Posts: 28Questions: 0Answers: 0
    So to understand i should include 1.7.1 into the same folder as datatables or when i call the js it should be in this order to enable my fading?




    to let you now this is my first working year experience which i have only 3 months under my belt :D but dont worry about taking it easy on me, as i do go research crazy to bring up my understanding.
    How much do guys normaly donate to your site, if i can get a range? i also wanna contribute.
  • allanallan Posts: 63,383Questions: 1Answers: 10,449 Site admin
    Doesn't matter at all where the file is called from, its just the order that is important. The browser will execute Javascript in the order that it finds it. So from above:

    [code]


    [/code]

    Loading jQuery twice is something that catches just about everyone out at some point. You are just a fast learner obviously ;-)

    Allan
This discussion has been closed.