473,322 Members | 1,690 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Help accessing elements in a frame.

I'm trying to help a friend out but couldn't find an answer so thought I'd
post here.
Is it possible to access the frame window at http://www.5460.net (a chinese
site)?
We're trying to get the DIV elements from its DOM.
We were trying:
alert(document.frames.document.getElementsByTagNam e('DIV').length);
with no luck.
Thanks for any help!

-Jeremy
Jul 23 '05 #1
2 1975
Hi Jeremy,
alert(document.frames.document.getElementsByTagNam e('DIV').length);
You forgot to specify which frame:

document.frames[0].document.getElementsByTagName('DIV').length;

or

document.frames['thename'].document.
getElementsByTagName('DIV').length;

The rest looks fine to me. If the content of the frame is loaded from
a different server there would be some security issues.

Good luck,
Vincent

Jeremy Gollehon wrote:
I'm trying to help a friend out but couldn't find an answer so thought I'd
post here.
Is it possible to access the frame window at http://www.5460.net (a chinese
site)?
We're trying to get the DIV elements from its DOM.
We were trying:
alert(document.frames.document.getElementsByTagNam e('DIV').length);
with no luck.
Thanks for any help!

-Jeremy


Jul 23 '05 #2
Vincent van Beveren wrote:
Hi Jeremy,
> alert(document.frames.document.getElementsByTagNam e('DIV').length);


You forgot to specify which frame:

document.frames[0].document.getElementsByTagName('DIV').length;

or

document.frames['thename'].document.
getElementsByTagName('DIV').length;

The rest looks fine to me. If the content of the frame is loaded from
a different server there would be some security issues.

Good luck,
Vincent

Jeremy Gollehon wrote:
I'm trying to help a friend out but couldn't find an answer so thought I'd
post here.
Is it possible to access the frame window at http://www.5460.net (a chinese
site)?
We're trying to get the DIV elements from its DOM.
We were trying:
alert(document.frames.document.getElementsByTagNam e('DIV').length);
with no luck.
Thanks for any help!

-Jeremy


If the OP loads another domain into a frame in his frameset, he will have no
access to the content within that frame.

This seems to be what he was asking for, and it simply won't work in the browser's
default security environment.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Trvl Orm | last post by:
I am working with 2 frames, Left and Right and the main code is in the left frame, which has been attached. Can someone please help me with this code. I am new to JavaScript and can't figure it...
15
by: Christopher Benson-Manica | last post by:
When are named elements written with script accessible to script? <html><head><script type="text/javascript"> function ready() { alert( document.getElementsByName("div").length ); }...
7
by: mike | last post by:
Hello, After reading all the past post and going to the faq on frameset tags I am still don't understand how this works and need some help on getting this validated if possible. Here is the error...
22
by: Luke | last post by:
Elements with name attribute: form, input, textarea, a, frame, iframe, button, select, map, meta, applet, object, param, img (if you know more reply...) Methods of addresing html elements:...
1
by: dj Bass | last post by:
I've got a situaion where there's one frame with a load of buttons, acting as a small control panel, with a datagrid object existing in another frame. On clicking on one button on the top frame,...
0
by: gunimpi | last post by:
http://www.vbforums.com/showthread.php?p=2745431#post2745431 ******************************************************** VB6 OR VBA & Webbrowser DOM Tiny $50 Mini Project Programmer help wanted...
5
by: saytri | last post by:
Hi i have this project were i have to do a quiz. i wrote the questions in a textfile and i called them through java. I have also made a menu to choose which type of quiz. But before accessing the...
1
by: jobbs64 | last post by:
I'm working on a game called carpet fishing...long story...anyways I am having trouble working with the fish that I've created. I need to be able to access their Fish Class method move() so I can...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.