page-refresh

Django refresh page if change data by other user

柔情痞子 提交于 2019-12-06 05:30:29
I have a test django app. In one page the test show the same question to all users. I'd like that when a user answers correctly, send a signal to other active user's browser to refresh to the next question. I have been learning about signals in django I learning work with them but I don't now how send the "refresh signal" to client browser. I think that it can do with a javascript code that check if a certain value (actual question) change and if change reload the page but I don't know this language and the information that I find was confused. Can anybody help me? Many Thanks. There is no

Python selenium refresh if wait more than 10s

浪尽此生 提交于 2019-12-06 04:07:39
from selenium import webdriver driver=webdriver.Firefox() driver.get(url) Sometimes the webdriver is stuck on a file or response and the page is never full-loaded so the line driver.get(url) is never finished. But I already got enough source code to run the rest of my code. I am wondering how can I bypass or refresh the page if the page is not full-loaded in 10 seconds. I have tried from selenium import webdriver from selenium.common.exceptions import TimeoutException driver=webdriver.Firefox() driver.set_page_load_timeout(10) while True: try: driver.get(url) except TimeoutException: print(

Keep the same colour after page refresh

十年热恋 提交于 2019-12-06 03:45:15
When I click the div , the color of the span changes to red , as i expected, but when I refresh my page the color isn't red , it returns back to original color, in my case green . How can I preserve the same color (red) after refreshing the page? I event tried with .apend() but the situation is the same. This is my HTML: <span>Green</span> <div id="changeColor"> </div> jQuery: $('#changeColor').click(function(){ $('span').css({"background-color":"red"}); }); Thank you all :D Take a look at this jQuery cookie plugin . You can use it (or a smilar plugin) to create / read and store information in

Stop Javascript and HTML from Loading From Cache

走远了吗. 提交于 2019-12-05 07:20:10
I am building a single page javascript app and when the application starts I use a single javascript file to load every other file I need on the fly. When I hit refresh, according to firebug, my HTML page as well as javascript pages will load with a 304 Not Modified Error and my javascript stops working. I understand this is due to browser caching, but how can I avoid this? I load the initial HTML page with a single script call <script src="js/config.js" type="text/javascript"></script> and then continue to load the rest dynamically from within that script window.onload = function () { var

Force browser to reload applet everytime

∥☆過路亽.° 提交于 2019-12-05 02:54:34
问题 I have depolyed my applet using deployJava.js and not using or tag. So, first of all, all those questions you might think as duplicate of this questions, are not exactly duplicate. Currently, when I refresh my page(contain applet) browser tries to reload the older applet which is causing complications like non-responsive applet. I want to force reload applet, from server and not from browser cache, every time I refresh page and that too without any manual work (like closing/reopening browser

How do I display randomly-chosen text with an associated image?

浪子不回头ぞ 提交于 2019-12-04 21:09:06
I'm a beginner web designer and I need to know how can I link one thing to another. The thing is that I'm making different quotes change every time the site refreshes. And I need to do the same thing with images that are located in a different div tag. The reason I need to link them is because the image needs to coordinate with the quote. For example: quote 0 with image 0. Here is the javascript code: var quotes=new Array(); quotes[0] = "text1"; quotes[1] = "Text2"; quotes[2] = "text3"; quotes[3] = "text4"; var q = quotes.length; var whichquote=Math.round(Math.random()*(q-1)); function

Automatic web-page refresh using xdotool - not sending key after window focus

三世轮回 提交于 2019-12-03 14:49:33
Given: I have Firefox with the [Firefox Page Title] page open on my Ubuntu computer. Here is my command: xdotool search "[Firefox Page Title]" windowactivate --sync key --clearmodifiers ctrl+r Documentation: xdotool website with documentation/examples is here . Example straight from the xdotool website: # As of version 2.20100623, you can do this simpler version of above: xdotool search "Mozilla Firefox" windowactivate --sync key --clearmodifiers ctrl+l Notes: I'm using xdotool version 2.20110530.1. The command correctly focuses my screen to whatever window title I choose, but it doesn't send

PRIMEFACES - How to refresh a <p:graphicImage> from clicking a <p:commandButton>?

≯℡__Kan透↙ 提交于 2019-12-03 13:56:39
I'm considering this showcase: http://www.primefaces.org/showcase/ui/dynamicImage.jsf in particular the sub-case "GraphicText on-the-fly". My problem is implementing an extended version of this sub case with the addition of a . When the button is pressed i need that the image change dinamically. In the DynamicImageController class I re-writed the getter associeted with the graphicImage: public StreamedContent getGraphicText(){ double random = Math.random();// a double value with a positive sign, greater than or equal to 0.0 and less than 1.0. if(random>0.5){ BufferedImage bufferedImg = new

How to refresh ASP .NET MVC page when hitting browser back button

*爱你&永不变心* 提交于 2019-12-03 07:05:30
I just found that when I click browser back button on any ASP .NET MVC page nothing happens and page is not going be updated. And only if you click F5 it will be updated only. The main problem that I do some changes of DOM of the page i.e. add table rows select radio-buttons and etc and when I go back to page by hitting browser back button I have see no changes. How it can be resolved for ASP .NET MVC 5? Thank for any clue... P.S. I have read http://forums.asp.net/t/1304752.aspx?how+to+refresh+page+when+hitting+back+button but it does not help... Here is a proper solution http://dotscrapbook

How can I block page autorefresh in Google Chrome?

我的梦境 提交于 2019-12-03 03:43:30
问题 I would like to stop autorefresh page in Google Chrome, because it is a very annoying and memory consuming issue and I can't work with the developers tools. I'm trying to delete the refresh and setTimeout function from the script using Chrome's developers tools but I have no results. How can I block this annoying feature even for a while from the console? 回答1: Since <meta http-equiv="Refresh" content="300; URL=?refresh_ce"> removal using DevTools is not sufficient (it doesn't stop page from