0

I know virtually nothing about J-Query/Javascript, so this might be something obvious. I'm using the J-query plugin called Datatables. I'm trying to use the AJAX source method in accordance to the documentation here.

I'm initializing it like this:

<script>
    $(document).ready(function() {
                      $('#filetable').dataTable( {
                                              "bProcessing": true,
                                              "sAjaxSource": '/filelist.json'
                                              } );
                      } );
</script>

There's no fancy server side processing here. There's simply a file on the web server called filelist.json, and that's what I want. However my server is showing the request URL it's being given as /filelist.json?_=1396119501351 and is returning nothing since nothing exists at that URL. Where's all of those numbers and the question mark and whatnot coming from? I just want it to retrieve the file and use it as the datasource. Am I misunderstanding how this works?

1 Answer 1

1

It seems to me that the plugin is configured to set the jquery cache parameter to true, this will add a timestamp as a parameter to your request at _=1396119501351. Anything after the ? is just a parameter sent to the server, and will not effect the actual path at all. I really don't think the parameter is your problem, I assume theres another issue with your url.

For more information reference https://api.jquery.com/jQuery.ajax/

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks for pointing me in the right direction. Seems there's no easy way to disable this but I managed to configure the server to ignore the parameters and now it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.