473,241 Members | 1,858 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,241 software developers and data experts.

need a clue

I've been going through tutorials, APIs, posts on this newsgroup, this
newsgroup's faq, etc...

I have a function that describes the fields that an object claims to have and
I have found what that function reports to often be contradictory to what it
will actually respond to. I have seen objects whose toString method returns
"[object inaccessible]" (which Google is unaware of practically btw) return a
correct value when I request the "name" field, but even though they are
supposed to be of a certain type, "name" is the only field it acknowledges
having. I've watched practically all example code fail utterly. I have
combed the APIs for Opera, Mozilla, IE and found many useful methods I'd like
to use that don't run. I've watched code work, then quit working because I
changed a name then changed it back. My opinion of javascript thus far can be
summarized in the following posit:

Javascript is non turing-compliant,
in a given state, with a given set of inputs it may or may not do the same
thing as the last time it was in that state with those inputs.

I've been trying to get a frame to shrink to fit the contents because some
browsers will render a table in such a manner that even though the sum of
heights of the cells at the side of a picture is smaller than the height of
the picture, and the cell spacing is set to 0, the browser still adds a
spacing causing the cells at the side to be taller than the picture.

I have two frames declared as follows:

<frameset rows="90,*" border="0" onload="resize()">
<frame
src="http://gtda.hypersphere.org/photo_header.html"
scrolling="no"
name="header"
id="header"
/>
<frame src="http://gtda.hypersphere.org/photo" />
</frameset>

for now, I'd be happy if I could get resize() to simply alert me of the height
of that document, or maybe if I could just get it to follow the api's, or
possibly if I could figure out why I can access the frame by getElementById
(sometimes), but never by document or parent.document .frames[0] or
..frames.item("header") or anything else like that.

I haven't seen something this nonsensical since Thermodynamics or maybe trying
to decipher the Linux VFS layer.

help me comp.lang.javascript, you're my only hope...

--
Harrison Caudill | .^ www.hypersphere.org
Computer Science & Physics Double Major | | Me*Me=1
Georgia Institute of Technology | v' I'm just a normal guy
Jul 23 '05 #1
5 1321
Charles Harrison Caudill wrote:
I've been going through tutorials, APIs, posts on this
newsgroup, this newsgroup's faq, etc...

I have a function that describes the fields that an object claims
to have and I have found what that function reports to often be
contradictory to what it will actually respond to. I have seen
objects whose toString method returns "[object inaccessible]" (which
Google is unaware of practically btw) return a correct value when I
request the "name" field, but even though they are supposed to be of
a certain type, "name" is the only field it acknowledges having.
Javascript (more explicitly ECMAScript) is designed to be used to script
an object model provided by a host. It defines objects in the host's
object model as "host objects" and makes virtually no requirements of
their behaviour.
I've watched practically all example code fail utterly. I have
combed the APIs for Opera, Mozilla, IE and found many useful methods
I'd like to use that don't run. I've watched code work, then quit
working because I changed a name then changed it back. My opinion
of javascript thus far can be summarized in the following posit:

Javascript is non turing-compliant,
in a given state, with a given set of inputs it may or may not do the
same thing as the last time it was in that state with those inputs.
That impression will prove to be the result of human error.
I've been trying to get a frame to shrink to fit the contents because
some browsers will render a table in such a manner that even though
the sum of heights of the cells at the side of a picture is smaller
than the height of the picture, and the cell spacing is set to 0, the
browser still adds a spacing causing the cells at the side to be
taller than the picture.

I have two frames declared as follows:

<frameset rows="90,*" border="0" onload="resize()">
<frame
src="http://gtda.hypersphere.org/photo_header.html"
scrolling="no"
name="header"
id="header"
/> ^
Does XHTML recognise frame and frameset elements?
<frame src="http://gtda.hypersphere.org/photo" />
</frameset>

for now, I'd be happy if I could get resize() to simply alert
me of the height of that document,
And the definition of this "resize" function is? And its location
relative to the frameset?
or maybe if I could just get it to
follow the api's, or possibly if I could figure out why I can access
the frame by getElementById (sometimes),
You should be able to access the HTML FRAME and FRAMESET elements in the
frameset document with document.getElementById, but the elements within
a document DOM do not necessarily correspond with the frame (or global)
objects that belong to each contained frame.
but never by document or
parent.document .frames[0] or .frames.item("header") or anything else
like that.
Frame elements that have both IDs and name attributes should be
available as named members of the - frames - collection in the global
object at the frameset level in the tree of frame/window/global objects.

frames['header'] // in the correct context.

parent.frames['header'] // from a child frame.

The - frames - collection as a property of the document object is best
avoided as it is not as widely supported.
I haven't seen something this nonsensical since Thermodynamics
or maybe trying to decipher the Linux VFS layer.

help me comp.lang.javascript, you're my only hope...


If you don't make your code available for examination it is only
possible to guess what it is you are doing wrong, and with almost
infinite possibilities it isn't worth anyone's while guessing.

Richard.
Jul 23 '05 #2
Richard Cornford <Ri*****@litotes.demon.co.uk> wrote:
Charles Harrison Caudill wrote:
I've been going through tutorials, APIs, posts on this <snip rant>
Javascript (more explicitly ECMAScript) is designed to be used to script
an object model provided by a host. It defines objects in the host's
object model as "host objects" and makes virtually no requirements of
their behaviour.
I think I'm misinterpreting this, how does a javascripter predict the
behavior of the foundation classes?
That impression will prove to be the result of human error.
I'd actually attribute that one to 4am with too much climbing, not enough
food, and certainly not enough caffeine :-P
I've been trying to get a frame to shrink to fit the contents because


That's my real objective, I've seen examples where this can be done using
javascript, but none of them seem to work.
Does XHTML recognise frame and frameset elements?
It appears to:
http://academ.hvcc.edu/~kantopet/xht...t=xhtml+frames

I've become unfirmiliar with the various web technologies since I was 14.
Frame elements that have both IDs and name attributes should be
available as named members of the - frames - collection in the global
object at the frameset level in the tree of frame/window/global objects. frames['header'] // in the correct context.
I've seen numerous accounts where that *should* work, but in this case:

alert(frames['header']);

produces the text: "[object inaccessible]"

however:

alert(top.window.document.getElementById("header") );

produces the text: "[object HTMLFrameElement]"
parent.frames['header'] // from a child frame.
alert(parent.frames['header']) when called in the javascript of the child
frame doesn't even run, it errors out.
The - frames - collection as a property of the document object is best
avoided as it is not as widely supported.
ahh...
If you don't make your code available for examination it is only
possible to guess what it is you are doing wrong, and with almost
infinite possibilities it isn't worth anyone's while guessing.


Granted, in my 4am stupor I neglected to mention that I had done 6 hrs
of work on it and it would have been impractical to include the entire
history.

Thanks for such a speedy response!

--
Harrison Caudill | .^ www.hypersphere.org
Computer Science & Physics Double Major | | Me*Me=1
Georgia Institute of Technology | v' I'm just a normal guy
Jul 23 '05 #3
Charles Harrison Caudill wrote:
Richard Cornford <Ri*****@litotes.demon.co.uk> wrote:
Javascript (more explicitly ECMAScript) is designed to be used to script
an object model provided by a host. It defines objects in the host's
object model as "host objects" and makes virtually no requirements of
their behaviour.
I think I'm misinterpreting this, how does a javascripter predict the
behavior of the foundation classes?


"host objects" are not foundation classes. They are host objects. And you predict their
behaviour by reading the documentation on each user agent you want to support, then testing the
behaviour on each user agent you want to support to ensure it conforms to the documented
behaviour. Then you make sure that the behaviour fails gracefully in user agents which do not
support, or do not support in the same way, that host object.

Welcome to client-side browser scripting in the 21st century. :)
Does XHTML recognise frame and frameset elements?


It appears to:
http://academ.hvcc.edu/~kantopet/xht...t=xhtml+frames


Presumably you are including the !DOCTYPE for the Frameset DTD as indicated on that page.
Frame elements that have both IDs and name attributes should be
available as named members of the - frames - collection in the global
object at the frameset level in the tree of frame/window/global objects.

frames['header'] // in the correct context.


I've seen numerous accounts where that *should* work, but in this case:

alert(frames['header']);

produces the text: "[object inaccessible]"


Is 'header' from a different domain?
however:

alert(top.window.document.getElementById("header") );

produces the text: "[object HTMLFrameElement]"


Which may well be inaccessible if it is from another domain.
parent.frames['header'] // from a child frame.


alert(parent.frames['header']) when called in the javascript of the child
frame doesn't even run, it errors out.


You would use parent.frames['header'] from a sibling of 'header', not a child.

As Richard has already mentioned, a simple example of what you are trying to achieve would make
it possible for us to more closely examine the problems with your code. Also, simplifying what
you are trying to achieve very often reveals the solution to the problem you are attempting to
solve.

--
Grant Wagner <gw*****@agricoreunited.com>
comp.lang.javascript FAQ - http://jibbering.com/faq

Jul 23 '05 #4
Grant Wagner <gw*****@agricoreunited.com> wrote:

<snip>
support, or do not support in the same way, that host object. Welcome to client-side browser scripting in the 21st century. :)
It's like making estimations less inaccurate in Stastical Mechanics only
with Javascript instead of math and physics :-P
alert(frames['header']);
produces the text: "[object inaccessible]" Is 'header' from a different domain?
nope, same domain
Which may well be inaccessible if it is from another domain.
> parent.frames['header'] // from a child frame.


alert(parent.frames['header']) when called in the javascript of the child
frame doesn't even run, it errors out.


I misspoke, that was being run from the header frame (trying to get a
reference to itself).
As Richard has already mentioned, a simple example of what you are trying to achieve would make
it possible for us to more closely examine the problems with your code.


As I said before, I've tried so many permutations of so many different ways
to figure out the height of the body of the child frame after rendering that
I can't really give an example, because I don't really have a codebase, I have
a long and convoluted history of many many things I've tried.

I just wanted to shrink a frame to fit the contents.

I appreciate the response, but, honestly, my will has been broken for now;
I'll probably come back to this in a month or so, but it was never important
enough for the time I've already spent on it. I just got mad and wanted to
get it done.

After my little escapade in Javascript, I have much respect for anyone who
is capable of getting things done with this language.

--
Harrison Caudill | .^ www.hypersphere.org
Computer Science & Physics Double Major | | Me*Me=1
Georgia Institute of Technology | v' I'm just a normal guy
Jul 23 '05 #5
Richard Cornford wrote:
Charles Harrison Caudill wrote:
<frameset rows="90,*" border="0" onload="resize()">
<frame
src="http://gtda.hypersphere.org/photo_header.html"
scrolling="no"
name="header"
id="header"
/>

^
Does XHTML recognise frame and frameset elements?


You mean if an *XML parser* recogizes them? Yes, if you declare the
XHTML 1.0 Frameset DTD. However, using XHTML instead of HTML on the
Web is another issue, especially when nonsensically served as text/html.
PointedEars
--
If the wind changes it will freeze like that.
Jul 23 '05 #6

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

Similar topics

6
by: Robert Maas, see http://tinyurl.com/uh3t | last post by:
System login message says PHP is available, so I tried this: http://www.rawbw.com/~rem/HelloPlus/h.php It doesn't work at all. Browser just shows the source. What am I doing wrong?
4
by: kazack | last post by:
I posted a similiar question in this newsgroup already and got an answer which I already knew but didn't get the answer I was looking for so I am reposting the code and question differently in the...
0
by: Dan McCoy | last post by:
I'm new to MYSQL, having just finished my website. I have 1 thing left to try and do to make the site experiance as seemless as possable, but to do it I figure I need to do some sort of mysql...
35
by: Boobie | last post by:
I need to escape HTML chracters so <test> --> &lt;test&gt; Looks like there is no built-in JS function...anyone got one handy ? thanks
1
by: Richard Hollenbeck | last post by:
Hello Newsgroup. You have all been very helpful in the past and I thank you. I try to ask relevant questions so that they don't just benefit me, but also benefit the group. I'm currently...
7
by: Timothy Shih | last post by:
Hi, I am trying to figure out how to use unmanaged code using P/Invoke. I wrote a simple function which takes in 2 buffers (one a byte buffer, one a char buffer) and copies the contents of the byte...
2
by: wazoo | last post by:
I'm hoping someone here might help me with this. I'm putting the finishing touches on my intranet web app, and I'm adding some simple JavaScript to my VB.Net Webforms. This works:...
17
by: Chad A. Beckner | last post by:
Hey all, I've spent all day trying to figure this out. What I need is a script to grab a webpage and display it as an (thumbnail?) image on one of my pages. GotDotNet has a webservice to do...
21
by: asif929 | last post by:
I need immediate help in writing a function program. I have to write a program in functions and use array to store them. I am not familiar with functions and i tried to create it but i fails to...
2
by: Rawrcraze | last post by:
Unforeseen database error, noted. phpBB : Critical Error Could not query database for theme info DEBUG MODE SQL Error : 1064 You have an error in your SQL syntax; check the manual that...
0
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
0
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...

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.