How to force page refreshes or reloads in jQuery?

你。 提交于 2019-11-28 20:03:12
Diodeus - James MacFarlane

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

window.location.reload()

Replace that line with:

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

or:

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

Or better

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

that tends to work best across all browsers and mobile

user1016195

Replace with:

$('#something').click(function() {
    location.reload();
});

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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!