Closed Bug 307119 Opened 19 years ago Closed 18 years ago

javascript: if you reference parent.frames[0] your get "partent.frame[0] has no properties"

Categories

(Core :: DOM: Core & HTML, defect)

x86
Linux
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: suomi, Unassigned)

Details

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20041217

if from javascript you want to write into the frames of the parent object
(starting from parent.frame[0]), the browser writes into a new window and in the
javascript console you get "parent.frames[0] has no properties.


Reproducible: Always

Steps to Reproduce:
1. http:/ldap.ayni.com
2. fill in the following parameters:
   ldap Server: ldap.ayni.com
  Distinguished Name to Bind: cn=bugzilla,ou=ldif-test,dc=ayni,dc=com
  Password: morebugs
3. you get a new window with a top frame and a button frame. 
4. click the botton "ou=ldif-test,dc=ayni,dc=com" in the bottom frame.
5. click OK
6. in the top-frame click "view children"
7. there you are

Actual Results:  
mozilla does not write at all what it should write into partent.frames[0], and
what it should write into parent.frames[1] is written into a new window.
mozilla writes an error message into the javascript console: partent.frames[0]
has no properties"

Expected Results:  
mozilla should  update the top and the buttom frame of the parent window. 

with other browsers (opera, firefox, epiphany, IE, ...) the behaviour is as
expected, only mozilla fails.
Please test again with the current nightly trunk build:
http://mozilla.isc.org/pub/mozilla.org/firefox/nightly/latest-trunk/firefox-1.6a1.en-US.win32.zip
With a 1.8 branch & trunk seamonkey build (If I enable unrequested popup
windows), I get:
Error: w.document.LDAPSearch has no properties
Source File: https://ldapadmin.ayni.com/search_info.htm
Line: 21

It actually seems to work with Mozilla 1.7.11.
I don't thinkI understand what that code is trying to do.

Dumping in DOM
Assignee: general → general
Component: General → DOM
Product: Mozilla Application Suite → Core
QA Contact: general → ian
Version: unspecified → Trunk
this bug does not appear any more in mozilla 1.7.11
So is there a problem on trunk here?  If so, is there a minimal-ish testcase?
Keywords: qawanted
Well, I too get the error:
Error: w.document.LDAPSearch has no properties
It happens in this function:
function start_search() {
	var w = window.open("", "viewChildrenWindow")
	if (typeof w.document.LDAPSearch == "undefined") {
		w.close()
		w = window.open("", "searchWindow")
	}
	w.document.LDAPSearch.submit()
	self.focus()
}
But it seems logical to me that Mozilla throws an error here.
What is the type of LDAPSearch there?
It's probably this:
<input type="button" value="LDAPSearch"
onClick="parent.frames[1].openSearchWindow(this)">
in: https://ldapadmin.ayni.com/cgi-bin/ldap1.pl which is the top frame.
Weird, but now I'm not getting that js error anymore.
So is this still an issue?
(In reply to comment #8)
> So is this still an issue?

No, I've tested with current Firefox1.5.0.7 build, Firefox2 build, current trunk build, IE6 and Mozilla1.7.13, they're all showing the same, as far as I can see. I don't see any js errors occuring in the error console with those builds.
If someone else is still seeing this in current branch/trunk builds, then please reopen.
Status: UNCONFIRMED → RESOLVED
Closed: 18 years ago
Keywords: qawanted
Resolution: --- → WORKSFORME
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.