473,403 Members | 2,366 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,403 software developers and data experts.

No access to variables in parent document

Hi,

I have an index.html with a frameset with 2 php files. The top frame are
buttons, that refresh the lower frame or put different content in it.
Some of these pages have javascript-tabs and I keep the current tab in
an array in the parent document:

window.parent.curTab[window.location] = elNewTab;

elNewTab is the <divelement that is shown.

This works fine, with no errors in Firefox 2. However, if I try to run
it in IE7, I get 'Permission denied' errors (I installed DebugBar).
Apparently, writing the window.parent.curTab array is no problem, but
reading it is not allowed.

I tried to change the browser security settings (the site is in 'trusted
sites' now), to no avail.

Any help?

Bart Friederichs
Jun 27 '08 #1
9 1635
On Jun 9, 4:12 pm, Bart Friederichs <b...@tbwb.nospam.nlwrote:
Hi,

I have an index.html with a frameset with 2 php files. The top frame are
buttons, that refresh the lower frame or put different content in it.
Some of these pages have javascript-tabs and I keep the current tab in
an array in the parent document:

window.parent.curTab[window.location] = elNewTab;

elNewTab is the <divelement that is shown.

This works fine, with no errors in Firefox 2. However, if I try to run
it in IE7, I get 'Permission denied' errors (I installed DebugBar).
Apparently, writing the window.parent.curTab array is no problem, but
reading it is not allowed.
Are you saying that you can CHANGE the values in the
window.parent.curTab, but you can NOT read it back?
If so, then it is definitely a bug in IE7. This may be to do with
prevention of "cross-site-scripting"
>
I tried to change the browser security settings (the site is in 'trusted
sites' now), to no avail.
So, it has nothing to do with your security settings.
>
Any help?

Bart Friederichs
Jun 27 '08 #2
GArlington wrote:
Are you saying that you can CHANGE the values in the
window.parent.curTab, but you can NOT read it back?
Well. It's hard to know for sure that I can write them, because I cannot
read them. The 'access denied' occurs when trying to read, not when
trying to write.

My next try is to put these variables in the DOM, hoping I can
manipulate that.

Bart
Jun 27 '08 #3
Bart Friederichs wrote:
GArlington wrote:
>Are you saying that you can CHANGE the values in the
window.parent.curTab, but you can NOT read it back?

Well. It's hard to know for sure that I can write them, because I cannot
read them. The 'access denied' occurs when trying to read, not when
trying to write.
Chances are that your attempts at write access are silently blocked.
My next try is to put these variables in the DOM, hoping I can
manipulate that.
IIUC, you should not do that. Host objects need not to allow augmentation.
We discussed this several times already.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Jun 27 '08 #4
Thomas 'PointedEars' Lahn wrote:
Chances are that your attempts at write access are silently blocked.
How to fix this problem then? Are there any solutions to 'register' some
variables in the top frameset? Cookies?
IIUC, you should not do that. Host objects need not to allow augmentation.
We discussed this several times already.
Well, if I had XHTML, and registered a new namespace, I can put anything
I like in the DOM. However, I have to support IE and IE doesn't support
XHTML correctly, so that's not a viable solution.

Bart
Jun 27 '08 #5
Bart Friederichs wrote:
Well, if I had XHTML, and registered a new namespace, I can put anything
I like in the DOM. However, I have to support IE and IE doesn't support
XHTML correctly, so that's not a viable solution.
The solution I found was the following:

In the frame that stays available at all times (my navigation bar), I
registered the values in the 'name' attribute of a button. Works both in
IE and Fx. I know it is attribute-abuse, but completely rebuilding my
app takes way more time (and thus money).

Bart
Jun 27 '08 #6
Bart Friederichs wrote:
Thomas 'PointedEars' Lahn wrote:
>Chances are that your attempts at write access are silently blocked.

How to fix this problem then? Are there any solutions to 'register' some
variables in the top frameset? Cookies?
I don't think you can "fix" this "problem" other than with transparent
server-side URL rewrite.
>IIUC, you should not do that. Host objects need not to allow augmentation.
We discussed this several times already.

Well, if I had XHTML, and registered a new namespace, I can put anything
I like in the DOM.
You could not (and you would not need a new namespace for that). There is a
difference between properties of an (host) object and the attributes of the
element it represents. The DOM Specification for XHTML 1.0 documents and
elements is W3C DOM Level 2 HTML and it would be prudent to adhere to that.

However, you could probably set a properly declared user-defined attribute
of the element and read its value back. But you should not assume that just
because it is XHTML you can augment host element objects arbitrarily.

<LRN>With host objects, all bets are off.</LRN>
However, I have to support IE and IE doesn't support
XHTML correctly, so that's not a viable solution.
As I have said before, what you are trying is not viable either.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Jun 27 '08 #7
Bart Friederichs wrote:
Bart Friederichs wrote:
>Well, if I had XHTML, and registered a new namespace, I can put anything
I like in the DOM. However, I have to support IE and IE doesn't support
XHTML correctly, so that's not a viable solution.

The solution I found was the following:

In the frame that stays available at all times (my navigation bar), I
registered the values in the 'name' attribute of a button. Works both in
IE and Fx. I know it is attribute-abuse, but completely rebuilding my
app takes way more time (and thus money).
You should use the `value' property of an object that represents an
<input type="hidden" ...element instead. Making that the descendant
of a `form' element would be prudent, this way you could access it using
backwards-compatible standards-compliant HTMLCollection references.
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Jun 27 '08 #8
Thomas 'PointedEars' Lahn wrote:
You could not (and you would not need a new namespace for that). There is a
difference between properties of an (host) object and the attributes of the
element it represents. The DOM Specification for XHTML 1.0 documents and
elements is W3C DOM Level 2 HTML and it would be prudent to adhere to that.
Euh, as I understood it, XHTML is pure XML and there is nothing stopping
me to register a new namespace (could do that server side) and mixing
XHTML and whatever I can think of (some self-defined XML). That is
actually one of the powers of XML, and thus of XHTML (i.e. embedding SVG
in XHTML without needing a seperate file).

Bart
Jun 27 '08 #9
Bart Friederichs wrote:
Thomas 'PointedEars' Lahn wrote:
>You could not (and you would not need a new namespace for that). There is a
difference between properties of an (host) object and the attributes of the
element it represents. The DOM Specification for XHTML 1.0 documents and
elements is W3C DOM Level 2 HTML and it would be prudent to adhere to that.

Euh, as I understood it, XHTML is pure XML and there is nothing stopping
me to register a new namespace (could do that server side) and mixing
XHTML and whatever I can think of (some self-defined XML). That is
actually one of the powers of XML, and thus of XHTML (i.e. embedding SVG
in XHTML without needing a seperate file).
You are mistaken. Please read my posting, more thoroughly this time, again.
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
Jun 27 '08 #10

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

Similar topics

2
by: Richard | last post by:
**** Post for FREE via your newsreader at post.usenet.com **** HI, I am working on a project where I need to input data to a (local) HTML page using multiple form elements, such as text,...
3
by: Chris | last post by:
Hi, I'm really begginer in javascript. I created a form in a pop-up opened with javascript. how to recover variables of the form in the main page. Thanks for your help Chris.
2
by: Patient Guy | last post by:
I have a library of functions representing a filesystem interface (essentially a file selection interface, to be used in opening/reading/writing/closing files). Heavily scripted HTML document...
3
by: jimmygoogle | last post by:
I posted earlier with a scope problem. I think I resolved it in IE but in Firefox it still exists. Anyone have any ideas/experience with this? I attached my code sorry it is so long. You can...
10
by: Goran Djuranovic | last post by:
Hi all, Does anyone know how to declare a variable in a class to be accessible ONLY from a classes instantiated within that class? For example: ************* CODE ***************** Public...
1
by: Björn Langhof | last post by:
Hallo. Is it possible to set private variables "var c=..." in the parent class and use them in the inherited class? My parent class looks like this: function parentclass(){ var txt = 'foo';...
1
by: troytabor | last post by:
I was having an issue at www.logolounge.com where the form in the bottom frame was no longer accessible through javascript in FireFox 1.5.0.8. I found the solution and wanted to share it. The...
3
by: rick | last post by:
I have a situation where I want to write an extensible class that is capable of saving / restoring properties of classes derived from it. A simplified example is explained as follows;- class A...
5
by: Mel | last post by:
I need to access an element of my top window from inside an IFrame within that window. I tried: parent.MYFRAME.document.getElementById("LHS"); and i get a "Access Denied" is there a way to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...

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.