My javascript function cannot be found
<p>I have the following:</p>

<pre><code>$(function () {

    $.ajaxSetup({ cache: false });
    var dialogs = {};

    var formSubmitHandler = function (e) {
        ...
    }

}
</code></pre>

<p>then in another script I try to call </p>

<pre><code>function dialogClick(link) {

    $.get(viewUrl + parameters)
            .success(function (content) {
                if (content.match(/^[eE]rror/)) {
                    mvcOnFailure(data)
                } else {
                    $.modal({
                        title: title,
                        closeButton: true,
                        content: content,
                        width: false,
                        resizeOnLoad: true
                    }).find('form').submit(formSubmitHandler).end();
                }
            })
</code></pre>

<p>Note that I have cut out parts of the script to make it easy to read. There are no script errors showing just the following error:</p>

<p>In the second script I get an error message saying "SCRIPT5009: 'formSubmitHandler' is undefined' in Internet Explorer. </p>

<p>Am I calling it wrongly? I thought the function would be global and when I check
the script that it is inside of is attached to the page.</p>
