Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9078285
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T19:34:54+00:00 2026-06-16T19:34:54+00:00

I have the following jquery to setup my dataTable however the problem I run

  • 0

I have the following jquery to setup my dataTable however the problem I run into is that when two datatables with the same table id exist on the same page, it seems to not load correctly after the first one is loaded. I am using a loop to show multiple tables which is why I have multiple ones on the same screen. Is there a way to make this work? Maybe somehow adding a ++1 to each name as it loops through? would I just loop the JQ through the php code while doing the +1?

<script defer>
    $(window).load(function() {
        $('#backup-list').dataTable({
        "aaSorting": [[ 4, "desc" ]]
        } );
        $(window).resize();
    });

</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T19:34:55+00:00Added an answer on June 16, 2026 at 7:34 pm

    In HTML, an id can only be used once per page. They need to be unique.

    Try giving your tables different IDs:

    $("#table1, #table2").dataTable(...);
    

    Or you can give your tables a class, which can be used multiple times on a single page:

    $(".your-tables").dataTable(...);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following jquery function that submits to an iframe. The message sent
I have the following jQuery to modify a table cell when clicked -- it
I have the following Jquery that returns values from a dialog Box and fills
I have the following jQuery ajax call setup: function Testing() { var result =
I have setup the following jQuery UI Dialog within my document.ready() section, i.e: $(#dialog).dialog({
I have the jquery includes setup correctly I believe, datepicker is working. However, when
I came into a really strange situation. I have the following setup: Parent window
I have the following JQuery setup to drag and drop items from a list
I have the following setup: <asp:treeview cssclass=draggable><items...> <table /> And I set it up
I have a razor cshtml view that uses jquery. I get following error during

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.