reload

JQuery DataTables - AJAX reloading how to catch when nothing is returned

血红的双手。 提交于 2019-12-07 16:16:59
问题 I am using a datatable and allow records to be deleted from the database. After deletion, I reload the table to display the recent changes. However, if I delete the last record from the database, null is returned by the AJAX call and does not update the datatable (it still displays the record that was just deleted). My Call after the delete function is performed: oTable.fnDraw(); oTable.fnReloadAjax(); The console error here is: json.aaData is null [Break On This Error] for ( var i=0 ; i<json

Reloading page through javascript: avoid the “Postback” warning

故事扮演 提交于 2019-12-07 07:13:19
问题 I'm triggering a page reload through javascript, using the following: window.location.reload(true); However, in some cases (of previous postback), the browser is giving me the following warning "To Display the webpage again, the web browser needs to resend the information you've previously submitted...". Is there any way of avoing this message and just doing the postback anyway, because this might be confusing for the users? If I need to reload the page by another means, so be it. 回答1: I don

how to trigger/reload Masonry plugin on click

别说谁变了你拦得住时间么 提交于 2019-12-07 05:33:07
问题 Because i have different tabs, masonry is not loading the hidden items, so when i click on a new tab the images stack onto each other, i know this question has been asked before and answered with trigger masonry by clicking the tab, but how would i go about doing this without messing up the first tab. Currently calling masonry with $(function(){ $('#container').masonry({ // options itemSelector : '.item', columnWidth : 260 }); });` $(window).load(function(){ $('#container').masonry(); }); and

Mouseenter and Mouseleave to trigger timer on/off

点点圈 提交于 2019-12-06 15:35:59
How would I code a mouseenter event to trigger timer off and a mouseleave event to trigger the timer on ? If the timer interval is reached then webpage will refresh. I've tried to do it but couldn't work it out: <script> $(document).ready(function() { var timer; function start() { timer = setInterval(function(){refresh()}, 5000); } start(); $('body').mouseenter(function() { clearTimeout(timer); }); }).mouseleave(function(e) { var pageX = e.pageX || e.clientX, pageY = e.pageY || e.clientY; if (pageX <= 0 || pageY <= 0) { start(); } else clearTimeout(timer); }); function refresh() { window

JSF how to force hard reload of current page

自古美人都是妖i 提交于 2019-12-06 13:19:34
I use JSF 1.2. I have a view in which I have a h:commandButton with the following action: #{myBean.saveSomeData} When I click on the button, I want to save some data and like the data that are saved can change the display of my view, i would like to force hard reload (like a CTRL+F5 in my browser for example) of my page. To do that, I thought to this code : public void saveSomeData() { ... Save some data ... FacesContext context = FacesContext.getCurrentInstance(); String viewId = context.getViewRoot().getViewId(); ViewHandler handler = context.getApplication().getViewHandler(); UIViewRoot

jqgrid can't load specific page during reload data from server side

ⅰ亾dé卋堺 提交于 2019-12-06 11:54:49
问题 I'm using jqgrid 3.8.2, I'm trying to use below code to reload data from server side and show specific page, like current page. $("#mygrid").setGridParam({datatype:json}).trigger("reloadGrid",[{page:5}]); grid could load data from server properly, but always show first page instead of page 5. anybody could give me a hand on it? Regards Simon 回答1: I suppose that you use loadonce: true parameter. To reload the data from the server you set datatype : to 'json' (I hope that you use setGridParam(

Java Jinput: rescan / reload controllers

不羁的心 提交于 2019-12-06 09:03:41
问题 I am using java jinput library to read data from joypad, and I have trouble reloading Controllers , I use this to load them: public Controller[] findStickControllers() { ControllerEnvironment ce = ControllerEnvironment.getDefaultEnvironment(); Controller[] cs = ce.getControllers(); System.out.println(cs.length); //test ArrayList<Controller> sel = new ArrayList<>(); for (Controller c: cs) { if(c.getType() == Type.STICK) { sel.add(c); } } return sel.toArray(new Controller[]{}); } This works

Auto refresh table without refreshing page PHP MySQL

↘锁芯ラ 提交于 2019-12-06 08:29:01
问题 I have a very simple chat system I've built using PHP and MySQL (this is my second day ever using these languages) and I am wondering if there is any way to auto refresh the table data I'm pulling from my database and loading into an html table via PHP without having something like Javascript go and reload the whole web page... just reloading the html table with the data in it that PHP filled it up with.... Does that make sense? Here is my code if it helps (for /chat.php) <html><head></head>

Check for newer version of page, and if existing, reload

孤人 提交于 2019-12-06 07:16:47
Basically, I want my page (say page.html) to check if a newer version of page.html exists, and if so, refresh the page, and in doing so, bring up the newer version. I realize this happens automatically after some time- however, I want this to happen within the time of 30 seconds to 2 minutes. I'm not sure how this would be accomplished- perhaps some Javascript? if(/*newer version exists*/) { location.reload(); } The part I'm unsure about is how to detect if a newer version exists. I had an idea for a workaround- have a function that checks if some sort of "signal" has been sent (I'd send it

Greasemonkey script to reload the page every minute

淺唱寂寞╮ 提交于 2019-12-06 06:08:17
How to reload a page every 60 seconds? My attempt: setTimeout (location.reload, 1 * 60 * 60); I'm not sure what those numbers mean, or how to adapt them to reload after 60 seconds only. setTimeout(function(){ location.reload(); }, 60*1000); You have to pass a full function as first argument, and second is the time in millisecond. So in your case, 60 * 1000 You may give a function name, since it is a callable, however, location.reload is a method of the location object. It is callable, but when it is executed by the timer, the this context will not be the location object. This fact leads to an