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

Why does this NOT work

My Images are too large, so I will cut them way down

What is wrong with my code

snippet+++++++
var myImgs=document.getElementsByName("escoImg");
var numImgs=myImgs.length;

/* area of my question the below if statement */
if(myPtr)//true means previous button pushed
{
myImgs.reverse();//reverse the array does NOT WORK
}
//end of question area

for(var x=0;x<numImgs;x++)
{
if(myImgs[x].style.display=="block")
{
myImgs[x].style.display="none";
document.forms[2].elements[0].value=++x;
break;
}
}

if(document.forms[2].elements[0].value==myImgs.length)
document.forms[2].elements[0].value=0;

myImgs[document.forms[2].elements[0].value].style.display="block";

end snippet+++++++

it captures the correct elements. then if I want to hide the shown element
it works
I then can show the desired element.

But if I reverse the array BANG the hole thing dies WHY?

What is wrong with my code???
http://escokitchens.com/learning/kitcheView.html


--

Totus possum, totum Deum.
Totus ero, totum meum.
WSW
Oct 8 '06 #1
4 1287
Aquosus wrote on 08 okt 2006 in comp.lang.javascript:
var myImgs=document.getElementsByName("escoImg");
[,,]
myImgs.reverse();//reverse the array does NOT WORK
You are wrong in your conclusion.
Did you read the errortext?

While you can reverse() an array,
the above is not an array but a collection of objects.

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Oct 8 '06 #2
Evertjan. wrote:
Aquosus wrote on 08 okt 2006 in comp.lang.javascript:
> var myImgs=document.getElementsByName("escoImg");

[,,]
> myImgs.reverse();//reverse the array does NOT WORK

You are wrong in your conclusion.
Did you read the errortext?

While you can reverse() an array,
the above is not an array but a collection of objects.
I hate to admit it but I know very little about this stuff. I know C++ and
mySQL but not javascript. I will have to find where the errortext is
located.

Thanks

Warren
--

Totus possum, totum Deum.
Totus ero, totum meum.
WSW
Oct 9 '06 #3
Aquosus wrote on 09 okt 2006 in comp.lang.javascript:
I hate to admit it but I know very little about this stuff. I know C++
and mySQL but not javascript. I will have to find where the errortext
is located.
1 By clicking on the error icon in IE,
when the unfriendly "friendly errors" are switched off.

2 By reading thr error console in FF, I think.

Try:

======= test.html =======
<script type='text/javascript'>
replace(//,'')
</script>
=========================

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Oct 9 '06 #4

Aquosus wrote:
I hate to admit it but I know very little about this stuff. I know C++ and
mySQL but not javascript. I will have to find where the errortext is
located.
When there's an error, IE displays a little yellow triangle warning in
the lower left of the browser window. Double-click it to see the
error. Be sure to click the Previous error button if it's enabled.

During development, you should leave the error reporting on. Under
IE's Tools menu, Internet Options - Advanced, Browsing section, check
"Display Notification about Every Script Error". and probably should
uncheck "Show friendly HTTP error messages". The latter change will
display whatever the server responds with, instead of the built-in IE
error screen. This can be handy while debugging.

Cheers, Kev

Oct 9 '06 #5

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

Similar topics

7
by: Jonas | last post by:
This works fine in Win XP but does not work at all in Win 98. Private WithEvents objIExplorer As InternetExplorer I have to do it like this to get it to work in Win 98 Dim objIExplorer As...
3
by: Julian | last post by:
Hi I am trying to update a date field in my table but some how this simple code does not work, I know the select work because if I write the fields, it will show the data from the table but why...
5
by: me | last post by:
I have a Class Library that contains a Form and several helper classes. A thread gets created that performs processing of data behind the scenes and the Form never gets displayed (it is for debug...
22
by: Robert Bralic | last post by:
CAN anybody tell me any address where I can download some small(1000-2000) lines C++ proghram source. Or send me ,a small(1000-2000) lines C++ program source that I can compille with gpp under...
12
by: Frank Hauptlorenz | last post by:
Hello Out there! I have a DB2 V7.2 Database (Fix11) on Win 2000 Professional. It was before a NT 4 based Domain - now it is a Win 2000 Domain. The database server is a domain member. Now...
0
by: Jarod_24 | last post by:
How does tabindex work in ASP .net pages I dosen't seem to work quite like in regular forms. and there isn't any TabStop property either. 1 .How do you prevent a control form beign "tabbed"....
14
by: Anoop | last post by:
Hi, I am new to this newsgroup and need help in the following questions. 1. I am workin' on a GUI application. Does C# provides Layout Managers the way Java does to design GUI? I know that it...
89
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be...
14
by: webEater | last post by:
I have a problem, it's not browser specific, and I don't get a solution. I have an (X)HTML document, I show you a part of it: .... <!--<div class="pad">--> <div id="eventImages"><img src=""...
1
by: =?ISO-8859-1?Q?Lasse_V=E5gs=E6ther_Karlsen?= | last post by:
I get the above error in some of the ASP.NET web applications on a server, and I need some help figuring out how to deal with it. This is a rather long post, and I hope I have enough details that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.