Zelaron Gaming Forum  
Stats Arcade Portal Forum FAQ Members List Social Groups Calendar Search Today's Posts Mark Forums Read
Go Back   Zelaron Gaming Forum > The Zelaron Nexus > Science and Art > Tech Help

 
 
Thread Tools Display Modes

 
[Javascript] How to interact with a popup created by a different page?
Reply
Posted 2009-06-18, 02:33 PM
I have a popup window that can be opened from any page on a site. For the purposes of explaination, let's say it's a shopping cart display. Whenever someone adds an item to the cart from a page, I want to use Javascript to tell the popup to update itself.

The way this site works, there may be many pages open that can select items in different browser windows at the same time and they all need to be able to tell the popup to update itself. As a fallback, the popup will use AJAX to periodically check for updates, but if it could update instantly, it would be better.

Any ideas?
Old
Profile PM WWW Search
WetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusion
 
 
WetWired
 



 
Reply
Posted 2009-06-18, 03:19 PM in reply to WetWired's post "[Javascript] How to interact with a..."
Could you have an automatic timeout on the active popup that refreshes every x amount of seconds once the window is active?














Quote:
!King_Amazon!: I talked to him while he was getting raped
[quote][16:04] jamer123: GRRR firefox just like quit on me now on internet exploder[quote]
...
[quote=!King_Amazon!]notices he's 3 inches shorter than her son and he's circumcised [quote]
Old
Profile PM WWW Search
D3V is convinced there are no coincidences, only the illusion of coincidencesD3V is convinced there are no coincidences, only the illusion of coincidencesD3V is convinced there are no coincidences, only the illusion of coincidencesD3V is convinced there are no coincidences, only the illusion of coincidencesD3V is convinced there are no coincidences, only the illusion of coincidencesD3V is convinced there are no coincidences, only the illusion of coincidences
 
 
D3V
 



 
Reply
Posted 2009-06-18, 03:29 PM in reply to D3V's post starting "Could you have an automatic timeout on..."
Quote:
As a fallback, the popup will use AJAX to periodically check for updates, but if it could update instantly, it would be better.
Already doing that.
Old
Profile PM WWW Search
WetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusionWetWired read his obituary with confusion
 
 
WetWired
 



 
Reply
Posted 2009-06-18, 04:04 PM in reply to WetWired's post "[Javascript] How to interact with a..."
WetWired said: [Goto]
I have a popup window that can be opened from any page on a site. For the purposes of explaination, let's say it's a shopping cart display. Whenever someone adds an item to the cart from a page, I want to use Javascript to tell the popup to update itself.

The way this site works, there may be many pages open that can select items in different browser windows at the same time and they all need to be able to tell the popup to update itself. As a fallback, the popup will use AJAX to periodically check for updates, but if it could update instantly, it would be better.

Any ideas?

call.htm
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
var ajax = {
	focus : function() {
		// You can update the code when they
		// focus on the window.  No reference
		// is neccessary.
		var x = document.getElementById('tiger');
		x.value = parseInt(x.value) + 1;
	}
}
</script>
</head>
<body onfocus="ajax.focus();">
<input type="text" value="0" id="tiger" />
Use php to call session data right here!
</body>
</html>
index.htm
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript">
function startup() {
	popup = window.open('call.htm','YOU RANG','height=100,width=250');
	popup.window.focus;
}
</script>
</head>
<body onload="javascript:startup();">
STARTED!
</body>
</html>
This is the simplest and only way to go about doing what you want to do. Keeping a reference, is unrealistic, as it will be lost upon changing pages. Unless all pages are loaded via AJAX. If you do that, then sure, you can use a reference using opener to alter the data.
 
Work List
疲れていますから 寝むってありますね。 むずかしいです。 また、ケーキ屋で ケーキを食べていました。

I've considered being a translator, but I dunno. It feels like a lot of work. If someone gets angry then I have to deal with it, you know? I'd rather just relax.

 
Speed Test
 
Favorite Anime/Manga
#01 Clannad ~After Story~
#02 Trigun {Maximum}
#03 Koi Kaze
#04 Berserk
#05 Outlaw Star
#06 Slayers
#07 Desert Punk
#08 Spirited Away
#09 Fullmetal Alchemist
#10 Shakugan no Shana
#11 Death Note
#12 FLCL
#13 Tokyo Magnitude 8.0
#14 Toradora
#15 Gunslinger Girl

 
Anime List
Old
Profile PM WWW Search
Goodlookinguy seldom sees opportunities until they cease to beGoodlookinguy seldom sees opportunities until they cease to beGoodlookinguy seldom sees opportunities until they cease to beGoodlookinguy seldom sees opportunities until they cease to be
 
 
Goodlookinguy
 
 

Bookmarks

« Previous Thread | Next Thread »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules [Forum Rules]
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
World Record Thread CrOnIc-KiLlA World Record Thread 47213 2023-12-19 09:57 PM
Greatest computer Mouse ever created. Sum Yung Guy The Lounge 2 2009-04-30 05:49 PM
Zelaron Comic Page 10 Draco2003 Science and Art 2 2009-04-06 10:37 AM


All times are GMT -6. The time now is 02:16 AM.
'Synthesis 2' vBulletin 3.x styles and 'x79' derivative
by WetWired the Unbound and Chruser
Copyright ©2002-2008 zelaron.com
Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
This site is best seen with your eyes open.