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

How do I stop javascript execution?

Hi

How do I stop JavaScript execution when I encounter an error?

Is there something similar to PHP's exit or die function?

Thanks
Ralph
Sep 18 '07 #1
4 28718
Ralphz wrote:
How do I stop JavaScript execution when I encounter an error?

Is there something similar to PHP's exit or die function?
When will using Google become a school subject? [psf 6.2]

We had that exact same question only a few days ago, and a couple of good
answers to it.

http://jibbering.com/faq/
PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Sep 19 '07 #2
Thomas 'PointedEars' Lahn wrote:
Ralphz wrote:
>How do I stop JavaScript execution when I encounter an error?

Is there something similar to PHP's exit or die function?

When will using Google become a school subject? [psf 6.2]

We had that exact same question only a few days ago, and a couple of good
answers to it.

http://jibbering.com/faq/
Thanks for response.

I was actually trying to find something on the newsgroup and google. All
I have found is was something about using break or return. Return does
not work for me because i don't want to check if all the functions
return false. especially if i want to stop execution in function deep
down in call stack. Break on the other hand looks weird :)

Thanks anyway
Ralph

Sep 19 '07 #3
[Fullquote intended]

Ralphz wrote:
Thomas 'PointedEars' Lahn wrote:
>Ralphz wrote:
>>How do I stop JavaScript execution when I encounter an error?

Is there something similar to PHP's exit or die function?
When will using Google become a school subject? [psf 6.2]

We had that exact same question only a few days ago, and a couple of good
answers to it.

http://jibbering.com/faq/

Thanks for response.

I was actually trying to find something on the newsgroup and google. All
I have found is was something about using break or return. Return does
not work for me because i don't want to check if all the functions
return false. especially if i want to stop execution in function deep
down in call stack. Break on the other hand looks weird :)
You missed the part about exceptions.
PointedEars
--
var bugRiddenCrashPronePieceOfJunk = (
navigator.userAgent.indexOf('MSIE 5') != -1
&& navigator.userAgent.indexOf('Mac') != -1
) // Plone, register_function.js:16
Sep 19 '07 #4
Ralphz wrote:
Hi

How do I stop JavaScript execution when I encounter an error?

Is there something similar to PHP's exit or die function?

Thanks
Ralph
alert("error message") works well for me.
For debugging.
Sep 19 '07 #5

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

Similar topics

8
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...
2
by: Tom | last post by:
A Java applet has two methods stop() and destroy() that get called when the user moves to a different page. Does javascript have anything similar? thanks tom
2
by: Prasad | last post by:
Hi, I am writing a service which takes a long time to stop after the OnStop call is given by the Services Snap-in. The problem is I cannot cut down on the time that it takes to Stop. The Service...
1
by: umesh.vishwa | last post by:
I have a script tag in which I has set src for that script tag. But some time it takes time to load . So I need to stop this if it takes time. Please help me. <script language='JavaScript'...
9
by: Rea | last post by:
Hi eb I set some 'Stop' statements and also visual breakpoints in asp code (vbscript). I am doing that in Microsoft Script debugger. Than I refresh the original page and expect execution to halt...
0
by: Saran | last post by:
Hi, I am having a method that handles the click event of a button on the page. This method will also send an email. Sending email comes after several lines of code in the method. I was testing...
2
by: howa | last post by:
Are there any method to stop the current JS execution on a page safely, something like PHP's die() functuin ?
33
by: Sunny | last post by:
Hi, Sometime, when your script is too big, IE Gives you a warning "Stop Running This Script" A script on this page is causing Internet Explorer to run slowly. Does anyone knows, How to...
4
by: sphinney | last post by:
Hi everyone. I'm creating an application inside Access 2007. The application will retrieve data from various locations on my company's network servers. Depending on the time of day, alignment of...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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
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,...
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
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.