call a function within $(document).ready(function() {

call a function within $(document).ready(function() {

First of: I know it's something which has been written (well, typed) about a lot, but even though I found workarounds, I haven't been able to get around this limitation.

To get into details, a while ago I set up a page with a Highcharts graph, most of the code is pretty much the same as https://blueflame-software.com/using-highcharts-with-php-and-mysql/ , I based it on that.

The data.php was originally written in such a way that it got the data from the MySQL database between the moment of accessing the Highcharts page and 24h before that, and passing that data to the Highcharts graph. This works like a charm.

Today I added http://xdsoft.net/jqplugins/datetimepicker/ to the Highcharts page, with being able to change the date/time period in data.php as the goal.

I've gotten as far as:
- being able to set two dates with times and put them into separate variables
- passing those variables through to data.php and putting both into the mysql_query.

What I am unable to do is getting the Highcharts page to run the jQuery.get again and redrawing the graph.

I figured I'd put the jQuery.get code in a function and call that function after setting both dates/times. While attempting that, I found about about the limitation of not being able to call functions within $(document).ready(function() {, unless the call originates from in there.

So I moved the jQuery.get code to a function outside of $(document).ready(function() {, but that gave the same problem, but that won't work because the same thing happens with "var options", that cannot be accessed from outside $(document).ready(function() {.