Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Uncaught ReferenceError: localtion is not defined #4073


User avatar
0
jbalda created

Hi, In a MVC Core & JQuery project, when saving the create person (professional in my case) does not reload the page. The console displays an exception that says location is not defined. What can be?

In CreateProfessionalModal.js :

this.save = function () {
            //Save your modal here...
            if (!_$form.valid()) {
                return;
            }
            var professional = _$form.serializeFormToObject();
            _modalManager.setBusy(true);
          

            _professionalsService.createProfessional(professional).done(function () {
                _modalManager.close();
    **localtion.reload();**
            }).always(function () {
                _modalManager.setBusy(false);
            });
        };

EXCEPTION DATA:

Uncaught ReferenceError: localtion is not defined at Object.eval (eval at globalEval (<a class="postlink" href="http://localhost:62114/lib/jquery/dist/jquery.js?v=A5AzdeUZJBV1X2MpcCLHI_iCCTFSpBAn2RvZthKq5AM:338:5">http://localhost:62114/lib/jquery/dist/ ... q5AM:338:5</a>), <anonymous>:43:17) at fire (<a class="postlink" href="http://localhost:62114/lib/jquery/dist/jquery.js?v=A5AzdeUZJBV1X2MpcCLHI_iCCTFSpBAn2RvZthKq5AM:3182:31">http://localhost:62114/lib/jquery/dist/ ... AM:3182:31</a>) at Object.fireWith [as resolveWith] (<a class="postlink" href="http://localhost:62114/lib/jquery/dist/jquery.js?v=A5AzdeUZJBV1X2MpcCLHI_iCCTFSpBAn2RvZthKq5AM:3312:7">http://localhost:62114/lib/jquery/dist/ ... 5AM:3312:7</a>) at Object.deferred.(anonymous function) [as resolve] (<a class="postlink" href="http://localhost:62114/lib/jquery/dist/jquery.js?v=A5AzdeUZJBV1X2MpcCLHI_iCCTFSpBAn2RvZthKq5AM:3411:36">http://localhost:62114/lib/jquery/dist/ ... AM:3411:36</a>) at Function.handleResponse (<a class="postlink" href="http://localhost:62114/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.js?v=kgwv_knqbBGWov46FOIyKJkElndhius8GmAb4fiDnSI:126:34">http://localhost:62114/lib/abp-web-reso ... nSI:126:34</a>) at Object.<anonymous> (<a class="postlink" href="http://localhost:62114/lib/abp-web-resources/Abp/Framework/scripts/libs/abp.jquery.js?v=kgwv_knqbBGWov46FOIyKJkElndhius8GmAb4fiDnSI:23:34">http://localhost:62114/lib/abp-web-reso ... DnSI:23:34</a>) at fire (<a class="postlink" href="http://localhost:62114/lib/jquery/dist/jquery.js?v=A5AzdeUZJBV1X2MpcCLHI_iCCTFSpBAn2RvZthKq5AM:3182:31">http://localhost:62114/lib/jquery/dist/ ... AM:3182:31</a>) at Object.fireWith [as resolveWith] (<a class="postlink" href="http://localhost:62114/lib/jquery/dist/jquery.js?v=A5AzdeUZJBV1X2MpcCLHI_iCCTFSpBAn2RvZthKq5AM:3312:7">http://localhost:62114/lib/jquery/dist/ ... 5AM:3312:7</a>) at done (<a class="postlink" href="http://localhost:62114/lib/jquery/dist/jquery.js?v=A5AzdeUZJBV1X2MpcCLHI_iCCTFSpBAn2RvZthKq5AM:8754:14">http://localhost:62114/lib/jquery/dist/ ... AM:8754:14</a>) at XMLHttpRequest.<anonymous> (<a class="postlink" href="http://localhost:62114/lib/jquery/dist/jquery.js?v=A5AzdeUZJBV1X2MpcCLHI_iCCTFSpBAn2RvZthKq5AM:9120:9">http://localhost:62114/lib/jquery/dist/ ... 5AM:9120:9</a>)


2 Answer(s)
  • User Avatar
    0
    aaron created
    Support Team

    See @alirizaadiyahsi's reply below.

  • User Avatar
    0
    alirizaadiyahsi created

    Hi @jbalda,

    Actually error is clear: Uncaught ReferenceError: localtion is not defined Use window.location instead of location