stoping javascript from getting executed

is it possible to prevent further execution of javascript?

i include some javascript scripts with php in a header (with echo ''), but there are coming some other scripts later in the page which i can not always control, so it could be that my before included (with ) mootools javascript get later overwritten by another included mootools (which then possible is an older version, or is not complete etc.)

so is there a way thet i can stop the js at one point so that later js code will not be executed?

kind of like the die(); function in php, but without that it stops the page from being loaded.

thanks in before fabian

Answers


doesnt really exist. but you can put everything into a function and "return;" any given time to exit the function which would stop the execution of the rest of the code within the function.

super simple example in standard JS:

function init() {
    if(something happens) {
         return;
    }
}
init();

in terms of stopping the browser from executing other scripts within the page - not possible.


Need Your Help

Version Control for Graphics

version-control graphics versioning

Say a development team includes (or makes use of) graphic artists who create all the images that go into a product. Such things include icons, bitmaps, window backgrounds, button images, animations,

How to get collision detection working?

c# silverlight oop collision-detection

I have been trying for a while now and I cant seem to get my collision detection working, at the moment i have it commented out due to the fact its not working.

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.