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

How do I make an Image visible?

Cov
Hi,

I have the following code:
<script>
LeftCurtain=new Image(midPoint,ht);
LeftCurtain.src="images/black.gif";
LeftCurtain.left="0px";
LeftCurtain.top="0px";
LeftCurtain.visibility="visible";
</script>
Nothing appears. Not in Firefox, Opera or IE7.

Can anyone let me know what's wrong?

Sep 30 '07 #1
16 4974
David Mark wrote:
On Sep 30, 3:31 pm, Cov wrote:
<snip>
> LeftCurtain=new Image(midPoint,ht);

Where are these two parameters defined?
> LeftCurtain.src="images/black.gif";
LeftCurtain.left="0px";

LeftCurtain.style.left = "0";
Zero is zero, regardless of the unit. Also, you need to set the
position property to absolute, fixed or relative (default is static.)
> LeftCurtain.top="0px";

Same problem here.
<snip>

Not that it is a problem as such. Not providing a non-zero dimension
with a unit can be a problem but omitting the unit from a zero dimension
is not required.

A more significant issue may follow from the assumption that the object
returned from - new Image( ... ) - would have a - style - object. There
is no specification that could provide guidance, but historically that
has not necessarily been the case.

Richard.

Sep 30 '07 #2
Cov
On Sep 30, 11:10 pm, David Mark <dmark.cins...@gmail.comwrote:
Again, sounds like a pretty poor (or at least outdated) guide.
http://www.amazon.com/JavaScript-Def...1186893&sr=8-1

Sep 30 '07 #3
On Sep 30, 5:12 pm, "Richard Cornford" <Rich...@litotes.demon.co.uk>
wrote:
David Mark wrote:
On Sep 30, 3:31 pm, Cov wrote:
<snip>
LeftCurtain=new Image(midPoint,ht);
Where are these two parameters defined?
LeftCurtain.src="images/black.gif";
LeftCurtain.left="0px";
LeftCurtain.style.left = "0";
Zero is zero, regardless of the unit. Also, you need to set the
position property to absolute, fixed or relative (default is static.)
LeftCurtain.top="0px";
Same problem here.

<snip>

Not that it is a problem as such. Not providing a non-zero dimension
with a unit can be a problem but omitting
You lost me there unless you are talking about older browsers where
typeof(el.style.top) == 'number'.

the unit from a zero dimension
is not required.
Not required, it just seems silly to me to provide one. One caveat is
that Firefox returns "0pt" (of all things) for the computed style when
the unit is left off the assignment. It doesn't really matter as you
obviously ignore the unit in any case where the value is zero.
>
A more significant issue may follow from the assumption that the object
returned from - new Image( ... ) - would have a - style - object. There
Right. That's why I told the OP to use createElement.

Sep 30 '07 #4
Thomas 'PointedEars' Lahn said the following on 9/30/2007 6:16 PM:
Cov wrote:
>On Sep 30, 11:10 pm, David Mark <dmark.cins...@gmail.comwrote:
>>Again, sounds like a pretty poor (or at least outdated) guide.
http://www.amazon.com/JavaScript-Def...1186893&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.

And, what does the third edition have to do with the edition listed in
the FAQ?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 1 '07 #5
Cov
On Oct 1, 5:07 am, Randy Webb <HikksNotAtH...@aol.comwrote:
Thomas 'PointedEars' Lahn said the following on 9/30/2007 6:16 PM:
Cov wrote:
On Sep 30, 11:10 pm, David Mark <dmark.cins...@gmail.comwrote:
Again, sounds like a pretty poor (or at least outdated) guide.
http://www.amazon.com/JavaScript-Def...-Flanagan/dp/0...
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.

And, what does the third edition have to do with the edition listed in
the FAQ?

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ -http://jibbering.com/faq/index.html
Javascript Best Practices -http://www.JavascriptToolbox.com/bestpractices/
Funny; I ask for help on why a piece of code I write won't work and
get castigated for attempting something that, in the opinion of one
poster, is beyond me.

Then the whole thing degenerates into mud slinging and petty point
scoring.

Does ANYBODY come here for assistance or is this newsgroup solely for
the self-indulgence of the senior members?

Oct 1 '07 #6
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:
On Sep 30, 11:10 pm, David Mark <dmark.cins...@gmail.comwrote:
Again, sounds like a pretty poor (or at least outdated) guide.
http://www.amazon.com/JavaScript-Def...1186893&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.
Or you have proven to be inept enough to be the editor of the newsgroup's
FAQ and should be replaced by a more reasonable person ASAP.
Coming from you, that is hilarious.
BTW: It should be "c.l.js" or "cljs" to distinguish it from comp.lang.java.*
The newsgroup is comp.lang.javascript and its abbreviation has always
been clj/c.l.j and I will continue to refer to it as clj/c.l.j as my
mood sees fit.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 1 '07 #7
Cov meinte:
I read that and did ask for specifics and was advised to Google for
"JavaScript createElement appendChild." which produced no meaningful
results.
What do you understand by "meaningful results"? I suppose most of the
stuff I know about JS, HTML, PHP, MySQL etcpp. stems from online
resources - mainly queried with a search engine.

"javascript appendchild" gives me the German

http://de.selfhtml.org/javascript/objekte/node.htm

as first hit, which explains the above issue pretty well.

The first English hit is

http://www.howtocreate.co.uk/tutoria...ript/dombasics

which also sports a simple example how appendChild works.

Gregor

--
http://www.gregorkofler.at ::: Landschafts- und Reisefotografie
http://www.licht-blick.at ::: Forum für Multivisionsvorträge
http://www.image2d.com ::: Bildagentur für den alpinen Raum
Oct 1 '07 #8
In comp.lang.javascript message <47**************@PointedEars.de>, Tue,
2 Oct 2007 22:05:24, Thomas 'PointedEars' Lahn <Po*********@web.de>
posted:
>
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.

--
(c) John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Oct 3 '07 #9
Thomas 'PointedEars' Lahn a écrit :
BTW: It should be "c.l.js" or "cljs" to distinguish it from comp.lang.java.*
LOL

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

--
laurent
Oct 3 '07 #10
rf
Whover wrote:

Would you take this bloody shit offline please!

Oct 12 '07 #11
In comp.lang.javascript message <zJ*********************@giganews.com>,
Thu, 11 Oct 2007 20:42:01, Randy Webb <Hi************@aol.composted:
>
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.

--
(c) John Stockton, Surrey, UK. ??*@merlyn.demon.co.uk Turnpike v6.05 MIME.
Web <URL:http://www.merlyn.demon.co.uk/- FAQish topics, acronyms, & links.
Check boilerplate spelling -- error is a public sign of incompetence.
Never fully trust an article from a poster who gives no full real name.
Oct 12 '07 #12
Dr J R Stockton said the following on 10/12/2007 3:42 PM:
In comp.lang.javascript message <zJ*********************@giganews.com>,
Thu, 11 Oct 2007 20:42:01, Randy Webb <Hi************@aol.composted:
>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.
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.
In comparison with what all other active FAQ maintainers do, your
approach is ludicrous.
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.

Stop whining and let it go. Sheesh.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 13 '07 #13
In comp.lang.javascript message <jq*********************@giganews.com>,
Sat, 13 Oct 2007 00:26:04, Randy Webb <Hi************@aol.composted:
>Dr J R Stockton said the following on 10/12/2007 3:42 PM:
>In comp.lang.javascript message <zJ*********************@giganews.com>,
Thu, 11 Oct 2007 20:42:01, Randy Webb <Hi************@aol.composted:
>>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.

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.
>In comparison with what all other active FAQ maintainers do, your
approach is ludicrous.

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).

--
(c) John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Delphi 3? Turnpike 6.05
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htmclpdmFAQ;
<URL:http://www.borland.com/newsgroups/guide.htmlnews:borland.* Guidelines
Oct 13 '07 #14
Dr J R Stockton said the following on 10/13/2007 6:21 PM:
In comp.lang.javascript message <jq*********************@giganews.com>,
Sat, 13 Oct 2007 00:26:04, Randy Webb <Hi************@aol.composted:
>Dr J R Stockton said the following on 10/12/2007 3:42 PM:
>>In comp.lang.javascript message <zJ*********************@giganews.com>,
Thu, 11 Oct 2007 20:42:01, Randy Webb <Hi************@aol.composted:
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.
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.
No, it is the problem. You want to continue to whine about something
after the fact that you had ample opportunity to comment on before it
happened. You had no written objections at the time and now, after
almost a year, you want to whine and complain about it.
>>In comparison with what all other active FAQ maintainers do, your
approach is ludicrous.
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.
Either way, you have two choices:

1) Accept it.
2) Continue to whine like an 8 year old.
There is a mistake in the parenthesised text of FAQ 4.16 (ignoring the
missing comma).
Then read the FAQ, find out how to make a request to have it corrected,
and it will get corrected. Pay real close attention Section 5.2 and the
last line of the first paragraph of the preceding sub-section.
--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Oct 14 '07 #15
Laurent vilday wrote:
Thomas 'PointedEars' Lahn a écrit :
>BTW: It should be "c.l.js" or "cljs" to distinguish it from comp.lang.java.*

LOL

<news://comp.lang.java.security>
<news://comp.lang.java.setup>
<news://comp.lang.java.softwaretools>
`cljs' is ambiguous, indeed; however, `c.l.js' is not.
PointedEars
--
realism: HTML 4.01 Strict
evangelism: XHTML 1.0 Strict
madness: XHTML 1.1 as application/xhtml+xml
-- Bjoern Hoehrmann
Nov 7 '07 #16
Thomas 'PointedEars' Lahn said the following on 11/7/2007 10:16 AM:
Laurent vilday wrote:
>Thomas 'PointedEars' Lahn a écrit :
>>BTW: It should be "c.l.js" or "cljs" to distinguish it from comp.lang.java.*
LOL

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

`cljs' is ambiguous, indeed; however, `c.l.js' is not.
I am thoroughly impressed. It only took you 35 days to respond. WOW.

Either way, I am still going to refer to it as c.l.j, deal with it.

--
Randy
Chance Favors The Prepared Mind
comp.lang.javascript FAQ - http://jibbering.com/faq/index.html
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Nov 7 '07 #17

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

Similar topics

1
by: Vangelis Natsios | last post by:
I want to create a page with a scrolling image that will cause different messages to appear on another part of the page (say, another <div>) as the image will scroll. Imagine something like this: ...
8
by: Michael Satterwhite | last post by:
I'm opening a page that has a single image on it. I'd like to resize the window containing the image to the size of the image (slightly larger OK, not smaller). The width isn't a problem, but the...
1
by: marco | last post by:
I'm a newbie and i'm doing a little application that open image. I don't understand what i've to do to have a zoom of an image...i don't know where's the error. If anyone know a simple code tell me...
1
by: Daniel | last post by:
I have looked everywhere on the web for an answer to this and the only thing I can find is converting the image format when the file is present on the local filesystem. What I want to do is use a...
4
by: Shapper | last post by:
Hello, I have an image button in a web page. The default image is ShowPanel.gif. When the image is clicked I want the panel "myPanel" to become visible and the image button to change to...
10
by: mattmerc | last post by:
Hi all, I posted this about a week back with no response so I want to try again. I have a weird questions in regards to working with sql image data types. I know how to take the image type and...
6
by: Corobori | last post by:
I am writing a vb.net application where I need to store image in a SQL Server database, yes I know I shouldn't but my clients wants it and has his reasons to do so. In order to reduce the database...
0
by: =?Utf-8?B?UmljYXJkbyBGdXJ0YWRv?= | last post by:
I'm having problems on drawing an image inside a picturebox. The situation is this: I have a picturebox with an image.whenever i click the mouse right button, another picturebox will appear on top...
6
by: shapper | last post by:
Hello, I need to display a ranking using starts. 1 to 5. Can I create a single star image and then create, at runtime, the ranking image for each record using 1 to 5 stars? How can I do...
3
by: readnlearn | last post by:
hii everyone can any one please tell me how to display a image after 3 time wrong entering of password or user name.... am using captcha but cannt display in the same page.... please help mee
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: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
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.