How can I run a function on load as well as on button click?
<p>I'm looking to call the following method on my page load:</p>

<p>I'm not sure how to because its not a hardcoded named function like say 'function search()'</p>

<p>I realise there must be a easy way to do/reference this function using jQueryon my page</p>

<p>Many thanks for reading</p>

<pre><code>$(function() {
    $('#searchButton').click(function() {
        var url = $('#AbsolutePath').val() + 'AuditLog.mvc/IndexSearch';
        var iPage = (parseInt($('#txtPage').val())).toString();

        var data = {
            StartDate: $('#StartDate').val(),
            EndDate: $('#EndDate').val(),
            sUser: $('#SearchTextBoxUser').val()
        };

        $('#txtPage').val(iPage);
        $("#ResultsList").load(url, data, function() {
            $('#LoadingGif').empty(); $("#paging").hide(); $("#paging").show();
        });

        LoadCharts(); 
        $('#LoadingGif').empty().html('&lt;img src="' + $("#AbsolutePath").val() + 'Content/images/ajax-loader.gif" alt="Loading image" /&gt;');
    });
});
</code></pre>
