473,796 Members | 2,480 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 28746
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.de mon.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 bugRiddenCrashP ronePieceOfJunk = (
navigator.userA gent.indexOf('M SIE 5') != -1
&& navigator.userA gent.indexOf('M ac') != -1
) // Plone, register_functi on.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
2046
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
2721
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
2863
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 snap-in gives me the error saying that the service did not respond to the Stop call in a timely fashion. So is there any method by which I can get around this problem. Thanks Prasad
1
4540
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' src='http://iqcreate.trigonenginedev.com/parsers/templateParser?tid=1832'></script> The above code generate a javascript code.
9
4912
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 at these breakpoints but unfortunatly it does not.. I had allowed script debugging in both iis home directory and in internet explorer. Also i added everyone from active directory to be members of debugging group. Web Server is W2k sp4 and iis...
0
1389
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 upper part of the method, so i kept a break point in the upper part. The code execution comes to a break in that point. I examined the values and clicked "stop debugging" i.e., well before calling send email. But strangely it continued to send the...
2
4169
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
11634
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 correct that? Thanks.
4
27990
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 the planets, other unfathomable mysteries sometimes my company's network is very, very slow. I would like to provide the user of my application with a "Cancel" button on a form that will cancel/stop execution of the code (at whatever point it may...
0
10230
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
10012
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
7548
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
6788
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5442
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...
0
5575
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4118
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
3731
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2926
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.