?
Solved

Window.frames.count don't work!!

Posted on 2001-07-23
6
Medium Priority
?
949 Views
Last Modified: 2007-11-27
Why doesn't this piece of code work?

The ultimate aim is to get a value into the textbox on A_form-main from form-main

The error is Object does not support this property or method 'Window.frames.count'


Listing:form-main

<html>
<head>
<title>Welcome to RightFax
</title>

<body bgcolor=#FFFFFF>

<FRAMESET border="0" cols="25%, *">
  <FRAME src="A_form-main" NAME=RightFax_Main>
  <FRAME src="Test.asp">
</FRAMESET>

<SCRIPT LANGUAGE=VBScript>
<!--
msgbox Window.frames.count
-->
</SCRIPT>
</body>
</head>
</html>



Listing:test.asp

<%@LANGUAGE=VBScript%>

<%

If Request.ServerVariables("QUERY_STRING") <> "" then
    response.write "<html><head><title>A title</title><body>Clicked</body></head></html>"
else

%>

<html>
<head>
<title>A title</title>
<body>
<FORM METHOD=GET ID=Form1 NAME=Form1>
Body
<p NAME="P">P</P>
<INPUT TYPE=SUBMIT value="Hello">
<INPUT TYPE=TEXT value="MyText" NAME="Text1">
</FORM>
</body>
<%End If%>
</head>
</html>


A_form-main

<html>
<head>
<title>
RightFAX Main Menu
</title>
</head>

<body bgcolor=#FFFFFF>
<FORM>
<INPUT TYPE=TEXT NAME=UnreadFax>
</FORM>
</BODY>
</HTML>

0
Comment
Question by:andcu
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 
LVL 4

Expert Comment

by:jcs_clement
ID: 6308147
Well you can do this by using Javascript instead of VBScript on the client side.

<script language="javascript">
function fun(){
alert(window.frames.length)
}
<script>

<body OnLoad="fun()">


but remember that this is case sensitive :)

rgds
jcs
0
 
LVL 2

Accepted Solution

by:
DirkVe earned 200 total points
ID: 6308191
multiple problems:

1- You cannot add extra things (like text or code) in a page that defines the frames. A typical main frame looks like this:

<BODY>
<FRAMESET border="0" cols="25%, *">
 <FRAME src="frTest2.htm" NAME=RightFax_Main>
 <FRAME src="frTest2.htm" name="ikke">
</FRAMESET>
</BODY>

Any extra SCRIPT will not execute.

A solution is to write it in the BODY-ONLOAD.

2-
it's not
window.frames.count
BUT
window.frames.length

3- it will always return 0 because you're frames are not loaded yet (don't exist) when you load the 'main frame'.
0
 

Author Comment

by:andcu
ID: 6308205
More detail covered here.  I can't accept two answers unforunately!!
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Expert Comment

by:jcs_clement
ID: 6310989
Hi buddy,

well you can do that. You will have to ask the help desk people to do it :-)

Desperate to earn points yeah !! :)

rgds
jcs
0
 
LVL 3

Expert Comment

by:modder
ID: 6312215
Hi andcu,

How would you like to split the points, 50/50?

modder
Community Support
0
 

Expert Comment

by:ComTech
ID: 6685651
Split was never completed, I will leave a question for jcs_clement in this Topic Area.

Best regards,
ComTech
Community Support
0

Featured Post

Want to be a Web Developer? Get Certified Today!

Enroll in the Certified Web Development Professional course package to learn HTML, Javascript, and PHP. Build a solid foundation to work toward your dream job!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question