refresh dynamically built pages with buttons

General discussion on technical and managerial topics
no avatar
jude
 
Posts: 2
Joined: Thu Jul 29, 2010 6:23 pm

refresh dynamically built pages with buttons

by jude » Thu Jul 29, 2010 6:38 pm

I am new to web design and javascript. I am actually in the process of learning, however, I am building a page for my company that:

Builds the page dynamically. By this I mean I have the page divided into 4 sections (like frames but not frames), top part displays a clock and date, left side displays buttons to press which changes what is displayed on the right side of the screen. Then the bottom is just copywrite info.

My problem is: I want the page to refresh after x seconds of displaying something on the right side of the screen and return back to the original view of what was in the right side of the screen(Company logo). I can acomplish this using an addloadevent function I found on the web but the problem is the counter is based upon the initial screen - not the one displayed due to the selected button which is dynaically built. I want the refresh timer to be based upon the "new" page displayed and counted from there. I would also like to be able to have different values assigned to the seconds, depending upon which button was pressed. (ex: button A is the Home button so we can always get back there, button B displays personal info but I want it to only display for 10 seconds and then do an auto refresh, button c displays time clock tardies which should be display for 20 seconds before auto refreshing.)

I hope someone can help!

Thanks,

Jude

no avatar
tutorialspoint
Site Admin
 
Posts: 144
Joined: Fri Apr 27, 2007 6:52 pm

by tutorialspoint » Fri Jul 30, 2010 7:34 pm

Hi,

I would suggest to use a <div> element and then use jQuery to load whatever you like.

You can also use iframe to acheive the same.

Thanks

no avatar
jude
 
Posts: 2
Joined: Thu Jul 29, 2010 6:23 pm

by jude » Mon Aug 02, 2010 4:37 pm

Well, I am using a div and Jquery both already! Getting what I want to display is not the issue - the issue is the refresh to be based upon only the right side of the screen. Do you know how to make the refresh button to be based upon only that without using frames??

Thanks!

no avatar
mcloren
 
Posts: 7
Joined: Thu Jan 03, 2013 9:22 pm

by mcloren » Sat Jan 26, 2013 11:55 am

jQuery Mobile removes pseudo-pages from the DOM after they are navigated away from (this is for external pages only). You can stop this behavior on a single pseudo-page by adding the data-dom-cache="true" attribute to the data-role="page" element for the pseudo-page:

<div data-dom-cache="true" data-role="page">
...
</div>

Return to General Discussion