Problem with ajax i18n conf using cdn.datatables.net

Problem with ajax i18n conf using cdn.datatables.net

didiezdidiez Posts: 1Questions: 1Answers: 0

Link to test case: https://datatables.net/examples/i18n/ajax.html
Debugger code (debug.datatables.net):
Error messages shown: DataTables warning: table id=example - i18n file loading error. For more information about this error, please see https://datatables.net/tn/21
Description of problem: Datatables configured with ajax i18n stopped working for cdn.datatables.net urls (due to missing cors header in cdn.datatables.net?)

Answers

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    This is a bit weird! If I do a direct request to https://cdn.datatables.net/plug-ins/1.11.5/i18n/de-DE.json then the CORS headers are there. If I use Ajax like in the example, they aren't. But they are both plain GET requests! I'm not sure what is going wrong, but I'm looking into it.

    Allan

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    There is something weird going on in CloudFlare's cache. Adding a query parameter allows it to work correctly. Using a different host in the HTTP header allows it to work correctly. But a request from a datatables.net host, with no query parameter, gives an incorrect CORS header. It will be a cached version, but I can't delete the cache for it! I'm hoping it might time out shortly, and it seems to be specific to my host, so I've put a query parameter on the example for the moment and it loads okay now.

    Do you have a table which has a similar issue. Does it now work?

    Allan

  • macmicromacmicro Posts: 19Questions: 0Answers: 0

    j'ai lu votre réponse

    mais je viens d'essayer avec la version 1.13.7 cela fonctionne bien
    mais si je remet la version 2.0.4 ou 2.0.5 erreur de chargement du fichier json via cdn

    quel est le parametre que vous avez mis sur votre example ?

    merci

  • macmicromacmicro Posts: 19Questions: 0Answers: 0

    I read your response

    but I just tried with version 1.13.7 it works fine
    but if I reset version 2.0.4 or 2.0.5 error loading json file via cdn

    what is the parameter that you put on your example?

    THANKS

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Just a ?_ or ?{random-any-string} and I think it should work.

    I don't think CloudFlare cache clearing is working with the change in headers, which is very odd. Sorry for the trouble!

    Allan

  • macmicromacmicro Posts: 19Questions: 0Answers: 0

    ok I see I added ?_ to the json 2.0.5 file it works, but let's wait until the cdn is repaired, thank you

  • allanallan Posts: 61,972Questions: 1Answers: 10,160 Site admin

    Try it now :)

    Allan

Sign In or Register to comment.