How to force page refreshes or reloads in jQuery?

前端 未结 5 1207
误落风尘
误落风尘 2020-12-14 05:26

The code below displays a Google map and search results when you enter an address and hit the submit button. I\'ve been playing with it to try and force the page to complet

相关标签:
5条回答
  • 2020-12-14 06:01

    You can refresh the events after adding new ones by applying the following code: -Release the Events -set Event Source -Re-render Events

      $('#calendar').fullCalendar('removeEvents');
                      $('#calendar').fullCalendar('addEventSource', YoureventSource);         
                      $('#calendar').fullCalendar('rerenderEvents' );
    

    That will solve the problem

    0 讨论(0)
  • 2020-12-14 06:13

    Or better

    window.location.assign("relative or absolute address");
    

    that tends to work best across all browsers and mobile

    0 讨论(0)
  • 2020-12-14 06:18

    You don't need jQuery to do this. Embrace the power of JavaScript.

    window.location.reload()
    
    0 讨论(0)
  • 2020-12-14 06:18

    Replace that line with:

    $("#someElement").click(function() {
        window.location.href = window.location.href;
    });
    

    or:

    $("#someElement").click(function() {
        window.location.reload();
    });
    
    0 讨论(0)
  • 2020-12-14 06:21

    Replace with:

    $('#something').click(function() {
        location.reload();
    });
    
    0 讨论(0)
提交回复
热议问题