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 8038325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T03:12:01+00:00 2026-06-05T03:12:01+00:00

<script type=text/javascript charset=utf-8> //initialisation code $(document).ready(function() { $(‘#example’).dataTable( { sPaginationType: full_numbers, } ); }

  • 0
<script type="text/javascript" charset="utf-8">
//initialisation code
    $(document).ready(function() {
        $('#example').dataTable( {
             "sPaginationType": "full_numbers",



        } );
    } );

    var asInitVals = new Array();

    $(document).ready(function() {

        $("tfoot input").each( function (i) {
            asInitVals[i] = this.value;
        } );


        $("tfoot input").focus( function () {
            if ( this.className == "search_init" )
            {
                this.className = "";
                this.value = "";
            }
        } );
        $("tfoot input").blur( function (i) {
            if ( this.value == "" )
            {
                this.className = "search_init";
                this.value = asInitVals[$("tfoot input").index(this)];
            }
        } );

        var oTable = $('.exam').dataTable( {
            "oLanguage": {
                "sSearch": "Search all columns:"
            },
            "bStateSave": true,
            "fnInitComplete": function() {
                var oSettings = $('.exam').dataTable().fnSettings();
                for ( var i=0 ; i<oSettings.aoPreSearchCols.length ; i++ ){
                    if(oSettings.aoPreSearchCols[i].sSearch.length>0){
                        $("tfoot input")[i].value = oSettings.aoPreSearchCols[i].sSearch;
                        $("tfoot input")[i].className = "";
                    }
                }
            }
        } );

        $("tfoot input").keyup( function () {
            /* Filter on the column (the index) of this element */
            oTable.fnFilter( this.value, $("tfoot input").index(this) );
        } );

    } );
</script>

</head>

<body>

<table id="example" class = "exam" width="100%" border="1" cellpadding="0" cellspacing="0" class="pretty" align="center">

I am new to jquery programming. when I viwew the table in browsers I see the error:

Data Tables warning (table id = ‘example’): can not reinitialise Data
Table. To retrieve the data table object for this table, pass no
arguments or see the docs for bRetrieve and bDestroy

how to solve this problem??

  • 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-05T03:12:02+00:00Added an answer on June 5, 2026 at 3:12 am

    You are trying to initialize the same table twice. First you are running

     $(document).ready(function() {
        $('#example').dataTable( {
             "sPaginationType": "full_numbers",
    
    
    
        } );
    } );
    

    Which is trying to initialize datatables on the table with the ID of example. Then you try to initialize it again here:

    var oTable = $('.exam').dataTable( {
            "oLanguage": {
                "sSearch": "Search all columns:"
            },
            "bStateSave": true,
            "fnInitComplete": function() {
                var oSettings = $('.exam').dataTable().fnSettings();
                for ( var i=0 ; i<oSettings.aoPreSearchCols.length ; i++ ){
                    if(oSettings.aoPreSearchCols[i].sSearch.length>0){
                        $("tfoot input")[i].value = oSettings.aoPreSearchCols[i].sSearch;
                        $("tfoot input")[i].className = "";
                    }
                }
            }
        } );
    

    Here you are initializing a table with the class of exam. The table with the class exam, and the ID of example are the same table in this case. The error is basically saying, hey I already initialized this table once, I cant do it again.

    Remove the first block of code and it should solve your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Why i need to use: <script type=text/javascript charset=utf-8> //<![CDATA[ var _gaq = _gaq ||
<script type=text/javascript src=https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js></script> <script type=text/javascript> $(function(){ alert(jquery loaded); $.get('country.php?id=117',function(d){ alert('something'); }); }) </script> Well
Here is fragments of my HAML view: %script{:type => text/javascript, :src => assets/application.js} :javascript
Was looking at ways to clean up the following link : <a href=javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());><img src=/images/Social%20Media/pinterest.png/></a>
I have a jQuery script: $.ajax({ url: /scripts/secure/development/ajax.asp, type: POST, dataType: text, data: cmd=addresses,
I need to add the charset=utf-8 at the end of the script tags to
in ajax navigation pages, the classic document ready form for performing initialization javascript simply
I've tried to change filenames using following script: find dir/ -type f -exec mv
I am calling a service that return JSON data. Script: $.ajax({ type: "POST", url:
OK I have a simple script at http://kleague.org/test/ Type a movie name and it

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.