Solved

Window.frames.count don't work!!

Posted on 2001-07-23
6
942 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
6 Comments
 
LVL 4

Expert Comment

by:jcs_clement
Comment Utility
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 50 total points
Comment Utility
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
Comment Utility
More detail covered here.  I can't accept two answers unforunately!!
0
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
LVL 4

Expert Comment

by:jcs_clement
Comment Utility
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
Comment Utility
Hi andcu,

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

modder
Community Support
0
 

Expert Comment

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

Best regards,
ComTech
Community Support
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
This demonstration started out as a follow up to some recently posted questions on the subject of logging in: http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28634665.html and http://www.experts-exchange.com/Programming/…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

763 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now