There is no method called 'footable' within Object [object Object]

My plan was to make my tables responsive using the FooTable jQuery plugin, but I am struggling with integrating it into my website. Here is the CSS code I have:

<link href="FooTable-2/css/footable.core.css?v=2-0-1" rel="stylesheet" type="text/css"/>
<link href="FooTable-2/css/footable.metro.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="FooTable-2/js/footable.js?v=2-0-1" type="text/javascript"></script>
<script src="FooTable-2/js/footable.sort.js?v=2-0-1" type="text/javascript"></script>
<script src="FooTable-2/js/footable.filter.js?v=2-0-1" type="text/javascript"></script>
<script src="FooTable-2/js/footable.paginate.js?v=2-0-1" type="text/javascript"></script>
<script src="build/javascripts/application.js" type="text/javascript"></script>

Here is the JS code:

<script type="text/javascript">
    $(function () {
        $('.footable').footable();
    });
</script>     

And here is the HTML code where the table should be displayed:

<table class="footable">
<thead>
<tr>
  <th></th>
  <th data-hide="phone,tablet">Nummer</th>
  <th>Vorname</th>
  <th>Nachname</th>
  <th>Adresse</th>
  <th data-hide="phone,tablet">Telefon</th>
  <th>E-Mail</th>
  <th data-hide="phone,tablet">Geburtstag</th>
  <th>Kundentyp</th>
</tr>
</thead>
<tbody>

The error message I am getting is:

$('.footable').footable(); 
Uncaught TypeError: Object [object Object] has no method 'footable'

Any ideas on how I can resolve this issue?

Answer №1

It appears that a conflict has arisen between application.js (Bootstrap 3.0) and footable.js. To address this, I adjusted the sequence of script inclusions which successfully resolved the issue:

The inclusion order now begins with application.js:

<script src="build/javascripts/application.js" type="text/javascript"></script>

Following that, all FooTable scripts and CSS files were included:

<link href="FooTable-2/css/footable.core.css?v=2-0-1" rel="stylesheet" type="text/css"/>
<link href="FooTable-2/css/footable.metro.css" rel="stylesheet" type="text/css"/>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script>
<script src="FooTable-2/js/footable.js?v=2-0-1" type="text/javascript"></script>
<script src="FooTable-2/js/footable.sort.js?v=2-0-1" type="text/javascript"></script>
<script src="FooTable-2/js/footable.filter.js?v=2-0-1" type="text/javascript"></script>
<script src="FooTable-2/js/footable.paginate.js?v=2-0-1" type="text/javascript"></script>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Show WordPress content when Ajax triggers a modal

After some troubleshooting, I am still unable to resolve why my modal file is not displaying the WP content properly. Whenever I attempt a different approach, it results in a 500 (Internal Server Error), even though I have identified the cause of the Inter ...

The functionality of Jquery autocomplete can be inconsistent at times

I have implemented this code for autocompleting the input field. While it works well in most cases, there are some instances where it doesn't function as expected. This is relevant for iOS users, Android users, Windows 7, 8, and 10 users, as well as C ...

Using CSS to ensure that the cards have consistent heights when using both React and Bootstrap

I am currently working with Bootstrap 4 in React. I have encountered an issue where the card for Item 1 is shorter than that of Item 2, and I would like both cards to have the same height. Additionally, I anticipate adding more cards at the bottom in the ...

The object for checking Ajax connections is not providing any values

I've been working on creating a unique AJAX connection check object, but unfortunately I'm struggling to get it to function properly. :/ Here's the object structure: function Connection(data){ this.isConnected = false, this.check = funct ...

Utilize ASP.net to efficiently store and retrieve events in a SQL database

If you have an SQL database table named Calendar, here are the tasks you may want to accomplish: You can achieve the following using Ajax: Retrieve events from the database and pass a List to your website. Save events back to the database. Note that ev ...

Ensure child images in a flex row are adjusted to have a height equivalent to 100% of the surrounding content

Consider this example: .row { background: #F88; margin-top: 20px; } .cont { display: block; height: 82px; width: 82px; background-color: #0AF; } .txt { background-color: #0C0; } <link href="https://stackpath.bootstrapcdn.com/bootstr ...

Remove the final 5 characters from the HTML text

Below is the code block that I am unable to modify: <div class="parent"> <div class="wrap"> <span class="content">2026-01-31-08:00</span> </div> <div class="wrap" ...

What could be causing issues with my jQuery POST call?

I am attempting to establish authentication with a remote service using jQuery. Initially, I confirmed that I can accomplish this outside of the browser: curl -X POST -H "Content-Type: application/json" -H "Accept: appliction/json" -d '{"username":" ...

The Ajax request is displaying the URL instead of the expected posted data

Here is the html code along with JavaScript that I am working on: <div id="input_form"> <fieldset> <form id="myform" method="post" action=""> seq: <input type="text" name="seq" id = "seq"><br><br> ...

Tips for storing information from an HTML form in MongoDB utilizing radio buttons and checkboxes

I'm struggling with saving data from radio buttons and checkboxes in my HTML form to a mongo database. Can anyone help me with this issue? Below is the HTML code I am working with: <div class="form-group"> <label>Photo:</label> ...

Show the percentage of completion on the progress bar while uploading with AJAX

I'm having trouble updating the current upload value on my progress bar in real-time. I know how to do it when the progress bar has stopped, but I can't get it to update continuously. xhr.upload.onprogress = function(e) { if (e.lengthComputa ...

Nested elements not transitioning using CSS

Why is my transition not being applied to the submenu <a> tag? The color change is working fine, but the transition does not occur on hover. When I use the same rules on another element with a different main class, it works perfectly. It seems like t ...

Leveraging ajax for showcasing page content in a floating div container

I am in need of creating a button on my page that, when clicked, will display a floating div above the page and load another internal page. I believe this can be achieved using Ajax, but I have no experience with it and don't know where to start. Her ...

finding and retrieving every occurrence of the select directive and its corresponding selected values in Angular

I recently set up a chosen dropdown in my project using the following method. I added a select box with a "chosen" directive as an attribute to update and initialize a list, along with an ng-model on the select element. <select id="{{$index+1}}" class= ...

Error message: Django encountering a broken pipe due to AJAX POST request

Broken pipes occur due to conflicting requests, preventing the POST request from processing. In this case, two requests are being sent: Ajax Post redirect to /message.html Adding event.preventDefault() may resolve this issue. However, implementing prev ...

Tips for triggering a method when clicking instead of using v-for in Vue.js

I need help arranging an array of objects based on their ratings. Currently, I am able to display the items from highest to lowest rating using the v-for method. But, I would like to first display the objects in their original order and then have a button ...

How can I send a JSON array using jQuery's .post method?

After numerous attempts to work with json, I am now faced with a new challenge - How can I post this specific json array: [{"success":true,"filename":"agard.jpg"}] using jquery.post, $.post("process.php", json ,function(xml){ }); So that I can retriev ...

Creative CSS Techniques: Styling Initial Capital Letters (Drop Caps) in a CSS3 Multicolumn Layout

For the past year, the multicolumn css3 property has grown in popularity among different browsers. It's a good reason to consider implementing it on your website for improved design and readability. I decided to take it a step further and incorporate ...

Exposing the full binary in jQuery

Can anyone explain how jQuery can display the entire binary representation of a number without removing the leading zeros? Here is the code snippet: HTML: <input id="input" type="text" size="20"> <input id="result" type="text" size="30"> < ...

React.js experiencing issues with loading the splash screen

I am developing a Progressive Web App (PWA) and I am currently facing an issue with displaying the splash screen. In my index.html file, I have added the following code to the head section: <link rel="apple-touch-startup-image" media="scr ...