• Resolved hellside

    (@hellside)


    Hello
    I made a page like this, using the table: http://alan.binhoster.com/small-talk/
    The problem is, I have enable JavaScript and check every option below, but I still can’t let the table show 10 rows a page, it shows all, and no sorting option can be seen, please look into this matter and hopefully give me a solution.
    many thanks!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    thanks for your question.

    The problem here is that your server is set up to block requests to text files (with a .txt extension).
    However, the DataTables JavaScript library tries to load the text file http://alan.binhoster.com/wordpress/wp-content/plugins/wp-table-reloaded/languages/datatables/lang-zh_CN.txt, which contains the translated strings for the features. You can see the error message, when trying to open that link.

    You will need to contact your webhost to have them change this behavior in the server configuration.

    Best wishes,
    Tobias

    Thread Starter hellside

    (@hellside)

    thanks for your reply, though since it is a free service I am using, I doubt they will give any attention to my request.
    thanks anyway, at least I know the problem root, thanks again.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    yeah, in that case, chances are indeed not too good 🙁

    Best wishes,
    Tobias

    Thread Starter hellside

    (@hellside)

    Since I am not good with program, I have a silly idea, don’t know if it is possible.
    Can the program be modified in some way, to let the DataTables JavaScript library tries to load, not the text file, but a file like php or something? If I save the “languages/datatables/lang-zh_CN.txt” as a “lang-zh_CN.php”, can it be read then?
    Thanks
    Just some silly thought.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    yes, that’s actually a good idea, and it’s worth a try.
    You can use one of the many plugin filter hooks to modify the URL that is loaded. Please try this:

    – Make a copy of the “lang-zh_CN.txt” file and rename it to .php.
    – Add the following code to your theme’s “functions.php”:

    function wp_table_reloaded_change_language_file_url( $url ) {
      return 'http://alan.binhoster.com/wordpress/wp-content/plugins/wp-table-reloaded/languages/datatables/lang-zh_CN.php';
    }
    add_filter( 'wp_table_reloaded_url_datatables_language_file', 'wp_table_reloaded_change_language_file_url' );

    Regards,
    Tobias

    Thread Starter hellside

    (@hellside)

    hello, I tried edit the controller-frontend.php, and change”.txt”into”.php”,works fine now, but surely it will be undone when the next update of this plugin is applied, so I will try your method as well, thanks for the attention.

    Plugin Author Tobias Bäthge

    (@tobiasbg)

    Hi,

    exactly, all modifications of plugin files will be reverted when the plugin is updated.
    However, my method also requires some work when updating: You would have to recreate that copy of the lang-zh_CN.php file, as it also will be removed. So, an even better way might be to place that file in your theme folder, and then change the URL in my code accordingly. That way, you won’t have to do anything when the plugin is updated.

    Best wishes,
    Tobias

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘the javascript is unable to be loaded?’ is closed to new replies.