How do I make an Image visible?

G

Gregor Kofler

Cov meinte:
RightCurtain.position="absolute";
RightCurtain.left=midPoint;
RightCurtain.top=0;
RightCurtain.visibility="visible";
RightCurtain.border=1;

Sigh... It is YourObject.style.position. That's what David already wrote
in his very first response.

Gregor
 
T

Thomas 'PointedEars' Lahn

Please trim your quotes as recommended in the FAQ and FAQ Notes.

http://jibbering.com/faq/#FAQ2_3
http://www.jibbering.com/faq/faq_notes/clj_posts.html
[...]
RightCurtain= document.createElement('image');

The element type is `img', _not_ `image'.

You better test whether or not that DOM method is supported before you call
it. See the FAQ and search the Google archives of this group for
`isMethodType'.

Regarding code style, only identifiers of constructors should begin with
a capital letter so that it is obvious at a glance whether or not a
constructor is accessed.
RightCurtain.src="images/black.gif";

You better test whether or not `RightCurtain' (or better: `rightCurtain') is
an object reference that can be used before you use it.
RightCurtain.width=midPoint;
RightCurtain.height=ht;

That is OK, but it may be better if you used ....style.width and
.....style.height and the `px' unit for each length value instead.
RightCurtain.position="absolute";
RightCurtain.left=midPoint;
RightCurtain.top=0;
RightCurtain.visibility="visible";

Those are all CSS interface properties, you have to use
`RightCurtain.style.position' aso. to make it work.
RightCurtain.border=1;

CSS interface properties are better here, too.
document.body.appendChild(RightCurtain);

You better test whether or not there is an object reference that can be used
before you use it, and you should test whether or not the object has an
appendChild() method.
alert(RightCurtain.width+'x'+RightCurtain.height
+','+RightCurtain.border);

The alert shows the following: "632x428,1" as expected

You have attempted to augment a host object, and in this case it worked.
(Generally it is error-prone.)
and the Firefox error console shows no errors, but the page does not display.

BAD. Broken as designed.


PointedEars
 
T

Thomas 'PointedEars' Lahn

Randy said:
Thomas 'PointedEars' Lahn said the following on 10/1/2007 5:08 AM:
Randy said:
Thomas 'PointedEars' Lahn said the following on 10/1/2007 4:03 AM:
Randy Webb wrote:
Thomas 'PointedEars' Lahn said the following on 9/30/2007 6:16 PM:
Cov wrote:
Again, sounds like a pretty poor (or at least outdated) guide.
http://www.amazon.com/JavaScript-De...3533224?ie=UTF8&s=books&qid=1191186893&sr=8-1
Thanks for further confirmation that also this book can definitely and
safely be recommended against. How many more bad examples from it are
required until the FAQ maintainer eventually removes the recommendation from
the FAQ?
It won't be removed any time in the foreseeable future so you can -
safely - stop asking for it to be removed.
You as a *responsible* FAQ editor leaving a statement in the FAQ that this
book is "currently endorsed by c.l.j. regulars of comp.lang.javascript"
should first make sure that it *is* actually currently endorsed by the
regulars of comp.lang.javascript.
It is nice to see that you have assumed I haven't done something that I
did do. Can you post articles in the last 8 months where people have
commented on the book? I have read them all. Perhaps you should also.
There are at least 3 people posting here regularly (which is the definition
for "regular"; the definition is not "people [whose statements] you like")
who have explicitly or implicitly recommended against this book. If you
would be a reasonable person and a responsible FAQ maintainer, you would not
wait for enough negative statements to accumulate over months(!) but do a
strawpoll NOW to determine whether or not the statement in the FAQ is still true.

If I were to apply "reason" to the FAQ, 99% of it wouldn't exist the way
it is written.

What kind of ridiculous argumentation is this?

If I would assume in your favor that you mean many of the questions there
would not need to be asked if people would consult the available reference
material first, I agree; however, that does not make the need for answering
those questions disappear.

If I would assume instead that the answers in the FAQ are not of good
quality in your eyes, then why don't you do anything by yourself to change that?

The problem with your being the FAQ editor as I see it is that you have
taken the job and the title, but you don't take the responsibility that is
required to do the job properly. Instead of doing everything you can to
improve the FAQ so that it can be an instrument to save regulars' free time
and allow them to answer only the interesting questions, you only misuse the
authority that you have been given to keep the status quo as much as you
can, as bad as that is.

For example, if you would be a responsible FAQ editor, you would not wait
for other people to propose corrections for the FAQ, and you would not
dismiss statements about the FAQ that lack a suggestion for improvement;
instead, you would do a regular review as your free time allows it.

You would not wait for propositions of other people but whenever you
encounter something in the FAQ that you don't like the way it is you
would start a discussion in the newsgroup to collect opinions on how
the respective section could be improved.

You would not leave statements that are made in the name of *all* the
regulars of the newsgroup in the FAQ if there is any doubt that not all
regulars of the group support that statement. You would do a strawpoll
at least once to back up such statements in the FAQ.
Second, I am not going to do a strawpoll "NOW" every week
or two just to see what might have changed.

You have not done it once since you are the FAQ editor.

JFTR: I am a regular of this newsgroup (whether you like it or not), and I
do not endorse this book; instead, I strongly recommend against it. How
could I endorse a book in good faith that is already in its *fifth* edition,
has still proven to be *misleading* and *factually incorrect*, and still
requires its errata (available only on the Web, of course) as a "must read"?
One of the three people you refer to has also said that in the lack of a
better book that it was recommended not as a "good book" but as the
"least bad book". The possibility of writing a "good book" about JS is
virtually impossible as the time it takes to actually write the book
outlasts the time on the web that the information in the book is any good.

Then the corresponding statement has to be reworded, as simple as that.
Either way, I am not removing it from the FAQ - for now.

Removing it is not really the issue, it is only the ultimate consequence.
The issue is that there is a statement in the FAQ that is not the truth.
Fine, let me clarify it another way that - hopefully - satisfies your
pedantic desires:

I will continue to refer to comp.lang.javascript as clj for as long as I
participate in this group. I am not going to change the abbreviation
that I have used for this group for 10 years simply because you think it
could be confused with some other hierarchy.

That is what I mean when I am calling you unreasonable. It is mostly that
the argument comes from me that makes you refuse to even think about it.
"It has always been so" alone has never been a sound argument.


PointedEars
 
D

Dr J R Stockton

In comp.lang.javascript message <[email protected]>, Tue,
2 Oct 2007 22:05:24 said:
You would not leave statements that are made in the name of *all* the
regulars of the newsgroup in the FAQ if there is any doubt that not all
regulars of the group support that statement. You would do a strawpoll
at least once to back up such statements in the FAQ.

In English, in which language you are not as adept as you seem to think,
"the regulars" does not necessarily imply "all of the regulars"; indeed,
we should use "all of the regulars" if we want to mean that. It only
means a substantial majority of the regulars; maybe over 66%, better
over 75% or 80%; 90% seems too high a mark.
 
D

Dr J R Stockton

In comp.lang.javascript message said:
Thomas 'PointedEars' Lahn said the following on 10/2/2007 4:05 PM:
I asked David Mark, without looking at the FAQ itself, what a function
named StrU does. The first thing a reasonable person in javascript
would assume is that it is a Constructor function. It isn't. After
that, what StrU does is a guess at best. Same goes for StrS. You can
find them in 4.6

A silly question to ask. Those who come across the name in the FAQ will
have found it in a section dealing with rounding to string, and so
should readily realise that StrU rounds to string. A URL is provided
for those who want to know more. Those who wish to use the routine in
their own code should choose a name for it that suits their own ways.
And the FAQEditor can do likewise, though it will then be necessary to
indicate that, in the URL cited, it's called StrU.

Those who come across it in active use will see that its context expects
it to return a string, and that its first argument has been calculated
whilst its other arguments are generally numeric literals. If they want
to know exactly what it does, they must look it up; if they then see it
again, they will recall its nature.

<ASIDE>
Let us postulate that there is, in the collection of code that you have
developed, a FAQworthy item. You would not put it in the FAQ; but you
might put a copy of it in the FAQ (edited to be good HTML). You would
need to take care that any updates or corrections were made twice.

I don't work that way. Backups and server apart, there is one single
copy of StrU stored on my site; it is in include1.js. Page js-rndg1.htm
shows its reader what StrU is; but it does not contain StrU. Function
ShoFFF, also in include1.js, is called with an argument list including
the identifier StrU, and, lo, my readers can read StrU while reading the
page dealing with it - and can be certain that what they read as StrU is
what is executed. And therefore I name my functions to suit myself.
Second. You have to ask yourself "Who is that document intended for?"
and the reasonable answer would have to be "For new people to learn
from". The code in the FAQ is abominable and about the worst place to
try to learn from.

Well, the code in that part of the FAQ is, as you know, out-of-date.
And, AFAIK, you have published nothing better.
Want another one? The variable name in 4.13 is just plain bad. Having a
variable named value in conjunction with code that gets the value
property from a form control is just plain bad practice.

Then the FAQEditor should change it.
Another one? DynWrite. At one time, it covered NN4 as well with a
document.layers branch. The document.layers branch was removed (the
document.all branch should have been removed at the same time also) but
the document.all branch was left at the behest of John Stockton
because, at the time, he was still using IE4 and complained about the
"people of the world who couldn't upgrade" (for whatever reason). That
same argument could be said about layers but layers left and the all
branch stayed.

Incomplete description. A substantial contribution to the removal of
the .layers part was the fact that it did not really work in NN4, or
worked only under unstated conditions.
Simple DynWrite function:

function DynWrite(elemID,stringToInsert){
document.getElementById(elemID).innerHTML = stringToInsert;
}

I raised that issue with it and was summarily dismissed on it and the
code stayed the way it is.

The flip side is that if you expand the code so that it is easily
readable, easy to follow, and has names that identify what the code
actually does, then the document grows to the point that the size of
the document becomes unbearably slow on a dial-up connection. So, do
you make the code "newbe friendly" or do you keep it dial-up friendly?
It is a trade off and the code has stayed the way it is.

That's been answered. In the days of Jim, the FAQ was split into two
parts, one part IIRC posted on Mon & Fri and the other on Wed. It could
easily be split into three parts, and maybe cycled fortnightly.

But remember : in a shortish routine, one should not give variables
fully-explanatory names; as names are used repeatedly, that's bloat.
Give them terse names or acronyms, with comment if needed to say what
they are.
And yes, I posted and wrote my thoughts about the code and was reminded
of the dial-up file size problem and summarily dismissed the idea of
re-writing all the code in the FAQ.

The answer to that is simple. Because that is not what I agreed to do.
And, I have opined on the fact that most of the code in the FAQ sucks
when it comes to trying to educate new people to javascript.

I don't recall that we in general agreed to your intended /modus
operandi/. The job was on offer, and you hastily grabbed it.


You want the job? It is yours my friend. Email me and I will give you
an address that Richard sent me for Jim. He can set you up with a login
username/password and all will be fine in the world.

That would be another stupid decision; and you have not been authorised
to select a successor. Jim Ley could write at great unreadable length,
but took care to avoid doing so in the FAQ. Richard could and did write
in that manner, though mainly in Notes. You prefer to spend your time
in self-justification and futile argument.

The key phrase there is "as your free time allows it". When people post
a request for it to be corrected/improved I don't merely dismiss it.
But, when that request is to move a line that doesn't exist, or, it
says "That is not code the author of that code now recommends" then
yes, I summarily dismiss it.

You were expected to do that. The statement was inserted for the
benefit of an earlier enquirer, one who might have used the extant FAQ
code. It should have encouraged him to try the links provided. IIRC,
That has been one of my requests/requirements from day one was that I
*would not* simply sit around all the time and peruse the web searching
for improvements. If people see a problem with it that needs to be
addressed, the least they can do is post a start to the solution and
help save some of *my* free time.

No : you are supposed to be an expert. Therefore it is likely that, a
problem having been pointed out, you would be easily able to insert an
appropriate improvement without more ado; otherwise, you should ask for
assistance. The people most likely to perceive that a FAQ entry is not
a sufficient answer are those who need a sufficient answer, and so
cannot provide one.

The thread that JRS posted in and pointed out two typos in the document
were corrected - locally - while I read the post. Very simple, very
informative post and I responded to it by correcting the errors.

I though there were 3 typos cited.
In contrast, there is also a thread where he obtusely referred to a
section that didn't exist and requested I move a line (that didn't
exist) to before/after another line. I asked for clarification and got
none. Guess what? Nothing got moved.

No : you assumed that 2.0 referred to a section, directly after a
reference to a new paragraph 2.5. That's either naive or perverse.



You could do one on a vote of confidence ...

And your dislike of the book is duly noted.

In your opinion. And, even then, the entry is staying for now. Even if
you think it to be not true.

The wording is not optimal for the purpose. Consider something like
"Most c.l.j regulars believe the best book to be", which is a far
sounder statement.



You should use c.l.j or CLJ, not clj which looks like a Slovenian swear-
word. I advise CLJ.
And, JFTR, my moods will dictate whether I use c.l.j or clj (with or
without the periods), not to what I refer to it as.

You should at least be consistent, and if possible correct : consistency
aids those who search with Ctrl-F or otherwise.

Your mood would, or could, improve, if you were to refrain from arguing
with TL. Just state your disagreement, and then ignore him.
 
D

Dr J R Stockton

In comp.lang.javascript message said:
Dr J R Stockton said the following on 10/3/2007 4:24 PM:

What is silly is your opinion that capitalized function names and names
of functions/identifiers that do not identify what they do is
appropriate coding practices in the FAQ of this group.

Then complain to the FAQ editor and get him to change the code in the
FAQ.

You are making a very fallible assumption that the only place a person
would run across that function is in the FAQ or in your site. Very
flawed assumption.

Code in the FAQ, which is the responsibility of the FAQ editor, is there
for the FAQ readers to read. If a FAQ reader chooses to copy it
/verbatim/, responsibility for those who read a copy is now his, not
yours.

I won't note what functions are called in other documents. Code in the
FAQ should stand on it's own merits and that particular section of code
(among others) is downright hideous.

If the FAQ provides a link to a site, it is incumbent on the FAQ editor
to present whatever information may be needed to find the relevant part
of the indicated site.

You think a newbie (who that document is semi-intended for) will
understand that? They won't. If you want to believe they will, you are
welcome to use that flawed thinking.

Irrelevant. The FAQ is not expected to help those who don't read it.

<ASIDE>
If I were to sit and re-write the entire FAQ to correct some of the
core deficiencies in it, without consulting this group, I would be
doing something that I said I wouldn't do. Namely, I offered - and
agreed - to make updates to the FAQ after someone in the group asked
for an update/correction. And, they provided a suitable
correction/substitution. At *no* time have I ever agreed to be 100%
responsible for writing the technical aspects of the FAQ. And I never
will. *I* don't work that way.
</ASIDE>

That's why you should never have been entrusted with it. A FAQ
maintainer needs to be reasonably decisive, but not necessarily
infallible.

I don't recall ever saying I have. You are the only person to have ever
said it was "out-of-date" yet you have failed to post, in
comp.lang.javascript, a better alternative for inclusion in the FAQ.

Please remember that I was not in this thread providing a <FA*****RY>,
just informing a reader. When you want to see my current code, you know
where to look, and so does that reader.

To date, I am the only one that has ever mentioned it. Not much of a
group consensus to change it now is it?

You're not much of a manager, are you? One cannot expect a manifest
consensus on an un-mentioned matter. You are entitled to make
suggestions to yourself, in private or in public.

There is no need for document.all support in the FAQ. No matter why NN4
support was dropped. Nothing will change that either unless some half-
brained programmer writes a browser that uses document.all and not
getElementById.

Irrelevant; I was pointing out the omission in your statement.


Nothing wrong with that function AFAIK, except that to avoid confusion
its name should be different, and code should be indented to show
structure; and I'd prefer 3 more spaces in it.

And that has been covered before. I have no way, on the jibbering
server, to post articles automatically. It is the precise reason Jim
stopped and Bart started posting them. The process of creating the text
files for Mon/Wed/Fri is simple. It is just 3 more steps after running
the script to update the HTML file from the XML file. Whether the
Mon/Wed/Fri postings ever start up again is not up to me as I have no
way (short of manually posting them and I won't) of posting them. If
somebody (Bart or otherwise) offers to post the text versions then I
will start generating them. There is no point in me wasting my time if
they aren't going to be posted.

You're not much of a leader, are you?

But if all of the FAQ is not going to be posted during the course of
each week, then there is less need for concern about the size of each
item.

And you remember that if you follow the same practice *all* the time,
then you will always do things the same way and then you have no need
to decide whether a routine is "shortish" or not. It also prevents you
from renaming functions if they grow beyond being "shortish". And, if
the name of the function indicates what the function does, then there
is no need to comment what the function does, the name indicates it.

I wrote "in a shortish routine ... variables". That does not include
the name of the routine. In a five-line routine such as my StrU, with
one or two variables, long names are not needed. If the routine grows,
it's easy to stretch the names of the variables declared within it. But
the routine name may be used site-wide, in which case other
considerations also apply.

There's one strong reason against long variable names in javascript; a
mis-spelling is not detected by the system, as it would be in Algol,
Pascal, Delphi.


I don't recall a consensus that a FAQ maintainer should take so little
responsibility.

I spend my time doing what I agreed to do. As for "futile arguments",
that is probably true because I keep trying to get you to realize
reality and you keep avoiding it.

If you don't think your arguing is sensible (and I expect others would
agree), then don't argue.

But, if you want to avoid criticism of the way you do the job, then you
should do the job properly.

You actually think that people that cannot provide an answer are going
to be in a good position to deem an answer as insufficient?

Of course they are. If they cannot use the answer provided, then it is
inadequate.

More subtle judgement may be needed to tell whether it is a good and
sufficient answer.

What was naive or perverse was your inability to simply state "It
should be re-ordered in this order:" and then post an updated version.

Apologies for overestimating your intelligence; I really should have
known better.

I typically am consistent with it referring to it as c.l.j as I don't
recall using clj very often. CLJ is a possibility but to me it looks
like someones initials.

The only c.l.j in FAQ v9.86 is in the Book part; the rest are clj.

Does NATO look to you like someone's initials? Does USA? Does FAQ? I
see no instance of clj in the FAQ such that the context would support
interpreting CLJ as referring to a person.
 
D

Dr J R Stockton

In comp.lang.javascript message said:
Dr J R Stockton said the following on 10/9/2007 4:57 PM:

Nonsense. If the code stands on its own then there is no need to
present "whatever information" may be needed. The code should stand on
its own.

If code stands on its own, then there will be no need for such a link.
But if there is a link, then the reader must be able to find what is
needed.

For that code to stand on its own, you will need to publish a substitute
for the extra information on my site. That will make the section long.

You seem to have a lack of perception of Reality. Until you can display
the ability to understand and comprehend what I agreed to do (and have
done precisely that), then I won't argue with you.
Implausible.



It should be obvious to you whether I want to see your code or not.

Of course it is. But when you do want to read it, you will know where
to find it.

And nobody has said any different. What you failed to read and
comprehend was the way I would do updates. Go find it, read it,
comprehend it, understand it, and then maybe you will get a grasp on
the Reality of the situation. Until then, you are just whining about
something you don't know about.

Does anyone know of another equally weird FAQ maintainer?


That is what tools like JSLint are for.

Yes, to make up for deficiencies in the language.

The only person who fails to realize (or expresses that failure) that I
do exactly what I agreed to do is you.

You're not doing the job properly. What you said you would do is
irrelevant.

It is now changed - locally - to clj as well.


You are - incorrectly - assuming that I was referring only to the FAQ.
I wasn't.



ISTM unsatisfactory that the apparent owner of the Web site that hosts
the FAQ cannot be contacted (was postmaster@ tried?). When someone else
disappeared, I did a Web search and found his name too close to
"funeral". Happily, Google shows that (e-mail address removed) (Jim Ley) was
posting early yesterday. Perhaps he will return.

Otherwise, a new site should be sought.
 
D

Dr J R Stockton

In comp.lang.javascript message said:
Again, you refuse to accept what I agreed to do. What you keep whining
about is that I won't do more than I agreed to do. And in regards to
that, what I said I would do is *very* relevant.

The question is also one of whether we understood and agreed to that;
and of whether what you are now doing is satisfactory.

In comparison with what all other active FAQ maintainers do, your
approach is ludicrous.
 
D

Dr J R Stockton

In comp.lang.javascript message said:
Dr J R Stockton said the following on 10/12/2007 3:42 PM:

It was stated enough in the thread I pointed you to that if you did not
understand what I offered to do then it was because you took no effort
to understand it.

That is irrelevant.
What is "ludicrous" is your inability to accept that I offered to do
something and I have done exactly what I said I would do.

Which is not what needs to be done.

There is a mistake in the parenthesised text of FAQ 4.16 (ignoring the
missing comma).
 
T

Thomas 'PointedEars' Lahn

Laurent said:
Thomas 'PointedEars' Lahn a écrit :

LOL

<<<news://comp.lang.java.softwaretools>

`cljs' is ambiguous, indeed; however, `c.l.js' is not.


PointedEars
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,062
Latest member
OrderKetozenseACV

Latest Threads

Top