Chico Che wrote:
Stevo wrote:
>Chico Che wrote:
>>I have a ie window that launches a pop up window with no
menus/toolbars nothing just the page. When I run an bookmarklet on
main window it works fine but when I try running this on the popup I
get an access denied error. All the javascript is doing is getting
innertxt from a textbox. It works fine when main window is done but
when popup is used it does not work. If anybody can help would
greatly appreciate it.
[...]
[...] var d=document;var df = document.frames;var screen = "Not
Found"; var id = "@$@OBJ00002[1]";if(df.length != 0){df[0].focus();for (f=
0; f< df.length;f++){var scrvalue = df[f].document.getElementById(id);if
(scrvalue != null){screen = scrvalue.innerText;}}}else{var scrvalue =
d.getElementById(id);if (d!= null){screen = scrvalue.innerText}}alert
(screen);
The code doesn't handle the case that `scrvalue' is not an object reference
(e.g. is `null) because there is no element with that ID. The assignment
screen = scrvalue.innerText;
results in a TypeError (in IE: "Object expected") then. This is what
happened when I used the bookmarklet on an arbitrary document in
"Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; ...; .NET CLR 1.1.4322;
..NET CLR 2.0.50727)".
Anything else is specific to the document you are viewing; you should post
the URL of the opener. However, a likely cause of the error message is that
the supposed frame's content document is accessed through a domain different
from the domain of the popup document. This would be a security precaution,
by design, and cannot be reliably worked around.
Also, `document.frames' should be `window.frames', and `screen' should be
something else (as there is a host-defined property of the Global Object
with that name 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>