473,785 Members | 2,449 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How do you stop a javascript program?

While running a program that exceeds the array limits it issues an
alert. I want to then stop the program after filling in the output
boxes with blanks. How do you stop the program?
I have worked on this for days and tried searching the net, but have
found nothing.

Mar 4 '06
14 7478
wrote on 05 mrt 2006 in comp.lang.javas cript:
Perhaps you have learned something from my experience. Let's hope so.
Too many nit pickers are not familiar with real world experiences. I
am a hard knots laborer, electrician, with a degree in Mathematics that
applies production lessons from real work in the electrical trade to
programming. Something that I think is unique and beneficial to
academia types.


The academia types should be grateful.

But, who are you talking to?

Please quote what you are replying to.

If you want to post a followup via groups.google.c om, don't use the
"Reply" link at the bottom of the article. Click on "show options" at the
top of the article, then click on the "Reply" at the bottom of the article
headers. <http://www.safalra.com/special/googlegroupsrep ly/>

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 5 '06 #11
Zif
el*********@ele ctrician.com wrote:
I don't really try to meet the W3.org standards. 98 per cent of the
visitors to my site use IE5.0+.
Your decision to use proprietary, largely undocumented 'standards' is a
significant part of the cause of you maintenance problems.

I stopped trying to be compatible with
Netscape, Opera, and Firefox long ago.
That becomes self-fulfilling. If your site doesn't work with those
browsers, then people who use them will stop visiting your site.

I used to spend about 30 per
cent of my time on compatibility issues, but now have the attitude that
if the other browsers can't meet MS standards, then too bad. MS is
more of a standard setter than W3.org.
Your compatibility issues are most likely *because* you use MS as a
'standard'. Using W3C standards, in most cases, reduces
incompatibility . Microsoft is a contributor to and supporter of the W3C
standards you deride.

Also, most users of my site
have high speed connections so I don't worry about large file sizes. I
have one popular calculator that is 85k right in the web page and I
have not had one single complaint in six years. Besides, js files are
too hard to edit!
Your difficulty with editing the files is a direct result of them being
poorly written and your failure to follow even basic design principles,
much less standards.

I suppose I am not in line with academia, but then
I taught myself what I know, and speak from experience. I use
JavaScript because of the ease of use, but more than that, for the
portability. Write it, upload it, and it is available. And as far as
compact code like you suggest, I don't worry about that either. Let
the machines hum and do all the work, they are made for it.
So I am a sloppy programmer, but my site makes money. I would get an F
in your class, but I am not worried about grades any more either. Next
month I start drawing social security.


I'll presume that is because of your age rather than employability -
good for you.

A review of your code shows that there will be many maintenance issues
because of the poor structure of the code, complete disregard for basic
design principles and standards.

Do your qualifications as an electrician also qualify you to write
thousands of lines of production code and publish it as a public
resource with complete disregard for basic design principles and standards?

I'll bet you don't even know if your calculator will provide the correct
result in all cases - how did you test it? Do you have any
understanding of how to test it? If someone uses your calculator and
gets the wrong answer that subsequently causes damage to people or
property, what responsibility are you going to take for that? Do you
have professional indemnity insurance for the programs you write and
publish on the web?

You don't even mention on your site that your calculator will not work
for some browsers - your attitude is beyond irresponsible, it is negligent.
--
Zif
Mar 6 '06 #12
el*********@ele ctrician.com wrote:
Perhaps you have learned something from my experience.
Here's something you can learn from my experience with your code.

You make frequent use of the following function to check number entry
(incidentally, obfuscation makes maintenance even harder for you):

function e(U){
var T = true;
var i = 0;
var aD = U.length;
var ch;
while (i<aD){
ch = U.substring(i, i+1);
if ( ( (ch<"0") || (ch>"9") ) && (ch!=".") ){
alert("Invalid Entry");
T = false;
break;
}
i++;
}
return T;
}
In your 'Continuous Load' field, enter 1.1.1 and your program simply
dies without any error message.

How can this be harmful? Calculate the voltage drop for a conductor and
enter say 50 for the distance from supply (I got zero). Change that to
5000.0. and calculate the value again - guess what? No change to the
voltage drop, yet deleting the last '.' shows a drop of 2.9 (in my case)
- yet a user could happily print out your recommendation from the
previous entry without being told your program screwed up.
10 years in development, 10 minutes to find a bug.
Try putting 50,000 in the field - again, no error message but I'm given
a voltage drop of zero (which I'll guess is erroneous). So even when
you do detect an erroneous entry, you deal with it by giving a totally
wrong answer.

Guess you're just passing on a lesson from the school of hard knocks, right?

Let's hope so.
I hope you did.

Too many nit pickers are not familiar with real world experiences. I
am a hard knots laborer, electrician, with a degree in Mathematics that
applies production lessons from real work in the electrical trade to
programming. Something that I think is unique and beneficial to
academia types.


Too many idiots think that if it 'works' for a limited set of
circumstances it must be OK.

Maybe those academic types really do know something after all.

--
Rob
Mar 6 '06 #13
el*********@ele ctrician.com wrote :
I don't really try to meet the W3.org standards.
99.99% of all electrical appliances on this planet meet either a
national standard/specification or an international
standard/specification. Same thing with electricity traveling across
borders, across countries. Wires implement industry or army standards.
98 per cent of the
visitors to my site use IE5.0+.

Maybe it's because they don't have any other choice. Netscape 7.x, Opera
7+, Firefox 1.x, Safari 1+ and Icab all have the ability to "disguise"
themselves as IE 6. They can change the user agent string which
identifies them as a browser and browser version when visiting a site.
I stopped trying to be compatible with
Netscape, Opera, and Firefox long ago. I used to spend about 30 per
cent of my time on compatibility issues,
Maybe, at that point, it would have been back then useful to visit a
newsgroup like this one to seek help, assistance. The good thing about
W3C web standards is that most of these are supported by Internet
Explorer 6.
DHTML and DOM objects are different issues and not covered by W3C web
standards but then there are more and more convergence and agreements
than divergences.
but now have the attitude that
if the other browsers can't meet MS standards, then too bad.

Your attitude makes your website less accessible, not more accessible to
other browsers, to other platforms, to other web-aware applications, to
other media, etc...
MS is
more of a standard setter than W3.org.
You would not say that if 90% of your visitors were among Safari,
Firefox, Netscape 7.x, Icab users.
Also, most users of my site
have high speed connections so I don't worry about large file sizes.
You have a complacent attitude here. Visitors having problems with your
site (IE-specific or too big or whatever) will not come back:
realistically speaking, what else would you expect them to do?
I
have one popular calculator that is 85k right in the web page and I
have not had one single complaint in six years.

If any of your visitor could read your posts in this thread, then they
would have a confirmation of how useless, pointless writing you a
complaint would have been.

Besides, js files are
too hard to edit!
With an "Homer Simpson" attitude, yes. With an "Lisa Simpson" attitude,
anyone can learn ... by seeking useful assistance in newsgroup such as
this one.
I suppose I am not in line with academia, but then
I taught myself what I know, and speak from experience. I use
JavaScript because of the ease of use, but more than that, for the
portability. Write it, upload it, and it is available. And as far as
compact code like you suggest, I don't worry about that either. Let
the machines hum and do all the work, they are made for it.
A webpage should never assume that the users visiting a site has endless
system resources (CPU, RAM, high-speed connection). There are lots of
web-aware devices and applications which have modest system resources.
Accessibility laws are more and more recognizing this fact.
So I am a sloppy programmer, but my site makes money. I would get an F
in your class, but I am not worried about grades any more either. Next
month I start drawing social security.


Users/Visitors of a site (not us) always have the final word and they
are the ones who can force a site to file a bankrupcy form. That has
been the case during the dot-boom era (1999-2001) on the web.

Gérard
--
remove blah to email me
Mar 6 '06 #14
el*********@ele ctrician.com wrote :
Perhaps you have learned something from my experience. Let's hope so.
Too many nit pickers
Just forget about Thomas Lahn: most of regular posters and experienced
scripters in here don't like his attitude and harsch habits.
are not familiar with real world experiences.
I remember one company doing wires not meeting wire standards and they
were selling those wires for cheap. After a few fires that burn whole
houses, they were discovered.
I
am a hard knots laborer, electrician, with a degree in Mathematics that
applies production lessons from real work in the electrical trade to
programming. Something that I think is unique and beneficial to
academia types.


Your opinion does not make sense and is not realistic even in the field
of maths and electricity to begin with.

Gérard
--
remove blah to email me
Mar 6 '06 #15

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

Similar topics

8
2045
by: Eric Osman | last post by:
My javascript program has reason to want to stop. For example, function A has 5 lines, the second of which calls function B, which has 5 lines, the first of which calls function C. But function C discovers that something is very wrong so it does an "alert" saying something like Sorry, couldn't make the necessary connection
2
4005
by: Martyn Fewtrell | last post by:
Dear All I have a Windows 2003 Server with IIS6 where the validation controls on ASP.Net pages no longer work. I believe it to be specific to the server as if I create an ASP.Net page on the IIS Server of my Workstation (Win XP) with a text box, button and required field validator, this works fine. If I create the same page on the IIS6 Windows 2003 Server the validation control doesn't stop the post. I've tried different browsers and...
8
2051
by: Richard Maher | last post by:
Hi, I am in a mouseup event for button A and I'd like to disable=false button B before starting some work. Is there anyway that an event for button B can then fire before my event processing for button A's mouseup has completed? I beleive event processing to be single-threaded for good reason but I need a "stop" button and it's no good if it doesn't do anything until the other processing has finished :-)
1
3587
by: =?Utf-8?B?S2Vubnk=?= | last post by:
I have one bat file that contains a command to startup Java Program. Then, I would like to create a cluster job to call the bat file. In case of one computer is down, another computer can also call the bat file and startup my Java Program. For this purpose, I have tried to place the bat file into share drive of two computers which are cluster machine. Also, I used Generic Application to create a job to call my bat file and this job is...
2
4307
by: mark4asp | last post by:
Can I force the client to stop caching old stylesheets and javascript? In my dynamic web-site, I need to force the client to stop caching old versions of my stylesheets and javascript. Can I do this by including a querystring with the url with each external stylesheet and script file declaration? For example: <link type="text/css" rel="stylesheet" href="../images/menu.css?
8
12620
praclarush
by: praclarush | last post by:
Ok, I'm new to JavaScript and I'm taking a class for it the assignment in it I'm supposed to create edit a pre-made page to display a marquee that automatically scrolls for the user, as well as give an option to start, stop and reset the marquee. Now I have most of this done already, what I'm having problems with is that when i start the marquee it moves to the right, but i need to have it move from the bottom, upwards. heres my code (I'm not...
8
4406
by: Harati | last post by:
I prepared my own player using php For this ,i want code for play(),pause(),stop(). I tried a lot with player.controls.play() but no use
0
3284
by: =?Utf-8?B?am1hZ2FyYW0=?= | last post by:
My program needs to do X when someone 'starts using' their Windows user account, and it should do Y when they 'stop using' their Windows user account. By 'starts using' I mean they log on, unlock the desktop, resume from hibernate/sleep, or resume a session that was paused via Switch User. By 'stop using' I mean they lock the desktop, initiate a hibernate/sleep , or choose Switch User while logged on. For context, the program is a parental...
4
2095
by: Rajneesh Chellapilla | last post by:
I wrote this program. Its kinda of strange when I make a reset function reset(){c=0} its doest reset the setTimeout. However if I directly pass c=0 to the onclick button it does reset the timer. What is the logic of this? Here is the program: <html> <head> <script type="text/javascript"> var c=0; var t; function timedCount()
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9950
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7499
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.