Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript How-To
|
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 7th, 2004, 10:52 AM
Registered User
 
Join Date: Dec 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default javascript access elements of frame with dynamic .

**********************VERY URGENT*******************************

Hey,
  can any genious help in solving this problem..I am so sick trying for it. (I am new to Javascript)I have my webpage divided into 4 frames-> leftUp, leftRight,rightUp, rightBottom. Now, rightBottom has a location.href changed dynamically and that external page is having a table. And, I have to access the elements of this table loaded dynamically. I have tried calling parent.rigtBottom.document. blah blah.......

and so many things.....but then I saw I am having
parent.rightBottom.location.href = "somepage on my harddisk";
loadDataInTable();
The table frame is displayed fine when I run the page. but it says it cannot access the elements of this table in which I want to feed my data values.
I am setting its location.href but when I alert this location.href after setting....its stills displays the initial frame name.

Can anyone help?
I hope I am clear stating my problem! Thanks in advance.



 
Old December 7th, 2004, 11:09 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Assuming all pages are in the same domain (all on same web server or all on hard disk and all accessed via same protocol) then it is possible, otherwise you will be restricted by cross domain security, desined to stop malicious pages reading files from your hard drive. You would need something like (assuming the table has an id of "tblData"):

Code:
var oDoc = top.frames["rightBottom"].document;
var oTable = oDoc.getElementById("tblData");
oTable.rows[0].columns[0].innerHTML = "Hello!";
--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
How to execute Javascript of a non local frame? sunshineyos Javascript How-To 1 September 13th, 2007 06:42 PM
Javascript function remote frame Dj Kat Javascript How-To 2 January 6th, 2006 12:22 PM
Dropping javascript menu accross the frame tanusree_ghosh CSS Cascading Style Sheets 1 January 4th, 2005 05:27 PM
Question on dynamic changes to other form elements savoym Javascript 1 October 27th, 2004 10:17 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.