473,466 Members | 1,298 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

JS Error when accessing an element from another frame

1 New Member
Hello,

I have a problem when altering a DIV-element from another frame.
The frameset looks like this:

Expand|Select|Wrap|Line Numbers
  1. <frameset rows=0,0,* border=0>
  2.         <frame name=header src=/header.htm scrolling=no noresize="true" frameborder=0>
  3.         <frame name=border src=/border.htm scrolling=no noresize="true" frameborder=0>
  4.         <frameset cols=200,* border=0>
  5.             <frameset rows=*,0 border=0>
  6.                 <frame name=bodytree src=/emptytree.asp scrolling=no noresize="true" frameborder=0>
  7.                 <frame name=bodyref src=/ref.asp scrolling=no noresize="true" frameborder=0>
  8.             </frameset>
  9.             <frameset rows=*,0 border=0>        
  10.                 <frame name=body src=/login.asp noresize="true" frameborder=0>
  11.                 <frame name=bodycom src=/comm.asp scrolling=no noresize="true" frameborder=0>
  12.             </frameset>
  13.         </frameset>
  14.     </frameset>
Frame 'ref.asp' (bodyref) is not viewed on the screen and is used to maintain the login session object by refreshing it every 4 minutes using this simple piece of code:

Expand|Select|Wrap|Line Numbers
  1. <META HTTP-EQUIV="REFRESH" CONTENT="250; url=/ref.asp">
Now I want to check (every 4 minutes) in 'ref.asp' if things have changed in my database. If so, then update an element in frame 'bodytree' using this code:

Expand|Select|Wrap|Line Numbers
  1. parent.frames["bodytree"].document.getElementById('alerting').innerHTML = '<ul><li>Changed!</li></ul>';
The element 'alerting' is a simple DIV-element in the bodytree-frame.
Weirdest thing is that the element is being updated but I get this JS error:

Expand|Select|Wrap|Line Numbers
  1. 'parent.frames.bodytree.document' is empty or not an object
When I place the JS-code in a webpage from the body-frame then everything works fine. But when I place it in ref.asp I get the error. Does anyone have an idea why I get the error?

Thx...
Mar 3 '08 #1
1 1924
rnd me
427 Recognized Expert Contributor
when you call it from ref.asp, it is not in any frame.


likely using simply document.getElementById('alerting') to find it will work.
Mar 3 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Christian Roth | last post by:
Hi, how do I access the contents of a variable (or param) whose name is computed? Pseudo-code for demonstration, NOT WORKING: .... <xsl:param name="table.frame.void">border:...
10
by: Brian Conway | last post by:
I have no idea what is going on. I have a Login screen where someone types in their login information and this populates a datagrid based off of the login. Works great in debug and test through...
7
by: Ron | last post by:
Error Message:Unable to validate data. Stack Trace: at System.Web.Configuration.MachineKey.GetDecodedData(Byte buf, Byte modifier, Int32 start, Int32 length, Int32& dataLength) at...
5
by: snicks | last post by:
I'm trying to exec a program external to my ASP.NET app using the following code. The external app is a VB.NET application. Dim sPPTOut As String sPPTOut = MDEPDirStr + sID + ".ppt" Dim p As...
18
by: William | last post by:
I have the following javascript function that updates a scroll_list and sends the updated entry (with its index) to a server script ( i.e. http://mkmxg00/cgi/confirmUpload.pl ) for further...
14
by: Aaron Gray | last post by:
Hi, I want to access the properties of an IFrame but seem unable to get access to the IFrames document body. <html> <body> <iframe src="test.html" id="IFrame"></iframe> </body>
2
by: rbanerji | last post by:
I am building a BHO that is meant to popup a IHtmlPopup window on a mouse over image event. All the code works fine if the image is in the main Window. However if the image is in a frame then I...
3
by: Axel Gallus | last post by:
I wrote a javascript function which should return the html code between a frame's body tag: function load_frame_as_string( Framename ) { var Frame =...
2
by: funktacular | last post by:
Hi - I have some javascript that works when I run it from a server, but I need to run it locally. When I try to execute it locally I get the following error: Error: uncaught exception: Permission...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.