JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old December 12th, 2002, 11:15 AM
cavalierhome cavalierhome is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 5 cavalierhome User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
frames divs variables javascript.

I have an application that uses frames; in one of the frames I have a variable that gets changed dynamically by php code and a java applet. This variable changes often during any single browser session.

I need to accomplish the following:

In frame A I need to display variable "artistid" that I retrieved from frame B without reloading frame A:

I know how to get the variable like this:

var artistid = top.frames[3].pick3.artistid;

I need this to happen every few seconds automatically, without any clicking or rollovers or anything.

It has to work in IE4+ and NS4+

I know it has to do with layers and divs, and I know I will need some kind of setTimeout call but I am vary new at JavaScript and I can't figure this one out. PHP and Unix shell I'm good at but not JavaScript.

I know how to get it done using JavaScript and php IF I reload the frame but I have a lot of stuff in that frame and I don't want to reload it again, I just want to display the value of "artistid" every few seconds after having again retrieved it from frame A in case it has changed.

Can you please help me or point me to someplace where I could find what need?

Thank you so very much for your help

Paul

Reply With Quote
  #2  
Old December 12th, 2002, 11:54 AM
adios adios is offline
Senior Citizen
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2001
Location: leftcoast
Posts: 2,019 adios User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 15
Could give this a shot...


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>untitled</title>
<style type="text/css">

.artist {
font: 600 14px "comic sans ms";
color: coral;
}

</style>
<script type="text/javascript" language="JavaScript">

var IDtimer = null;

function setCell() {
var cell, artistid = 'Bob Dylan'; // top.frames[3].pick3.artistid;
if (artistid) {
if (!document.layers) {
cell = document.getElementById ? document.getElementById('readout') :
document.all ? document.all('readout') : null;
if (cell && typeof cell.innerHTML != 'undefined') cell.innerHTML = artistid;
} else {
cell = document.NSreadout.document.layers[0];
cell.document.write('<span class="artist">' + artistid + '</span>')
cell.document.close();
}
}
}

onload = function() {
IDtimer = setInterval('setCell()',5);
}

onunload = function() {
clearInterval(IDtimer);
}

</script>
</head>
<body bgcolor="black">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td id="readout" class="artist" width="100" height="16"><ilayer id="NSreadout"><layer width="100" height="16"></layer></ilayer></td>
</tr>
</table>
</body>
</html>


Last edited by adios : December 12th, 2002 at 12:19 PM.

Reply With Quote
  #3  
Old December 12th, 2002, 12:01 PM
cavalierhome cavalierhome is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2002
Posts: 5 cavalierhome User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
wow Ill try it, this is a lot more than I had hoped for.

Thank you so much for the help. I hope I am able to understand it well so I can use it.

Thanks again from me and from all the artist that will benefit from it.

Paul

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > frames divs variables javascript.

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap