473,837 Members | 1,709 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

JS Error when accessing an element from another frame

1 New Member

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?

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

likely using simply document.getEle mentById('alert ing') to find it will work.
Mar 3 '08 #2

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

Similar topics

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: none;</xsl:param> <xsl:param name="table.frame.box">border: 1pt solid black;</xsl:param>
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 VS, however, when I change to release and put it out on the web it fails giving me the following error message The underlying connection was closed. Could not establish a trust relationship with the remote server.
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 System.Web.UI.LosFormatter.Deserialize(String input) Has anyone seen this? Or know why it has ocured?
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 New System.Diagnostics.Process 'p.Start(MDEPDirStr & "macrun.exe", sPPTOut) p.Start("C:\WINDOWS\SYSTEM32\CALC.EXE") 'p.Start("C:\WINDOWS\SYSTEM32\macrun.exe", sPPTOut)
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 processing: function saveText( scroll_list, t_area, listToBeUpdated ) { scroll_list.options.text = t_area.text; scroll_list.options.value= t_area.value; var req; var url = "http://mkmxg00/cgi/confirmUpload.pl";
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>
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 get the following error: {"Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))"} System.Exception {System.UnauthorizedAccessException}
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 = document.getElementsByName(Framename); var Frame_document = Frame.document; var Frame_Body = Frame.document.getElementsByTagName("body");
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 denied to get property Window.processXML Is there a way to get around this issue? default.htm
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.