Jump to content

Infinite Loops


PrateekSaxena

Recommended Posts

Very often, while trying to write the code of my Animated Graphics Library, the code goes into infinite loops. so I have to force shut the browser and then start it again. Isnt there a way to terminate the script or something? Like [Ctrl]+[Pause|Break] or something?

Link to comment
Share on other sites

oh! thats a good idea...why did I not think of that..thanks man!

Link to comment
Share on other sites

he he.BTW I thought I would share the animation with everyone -

/*Universal Variables*/boxopen1=0;boxopen1tick=0;/*Universal Variables*/function initgraph(startx, starty, height, width, color, name, inside){	var here = document.getElementById(inside);	here.innerHTML += "<div id='"+name+"' style='position: absolute; top:"+startx+"px; left:"+starty+"px; width:"+width+"px; height= "+height+"px; overflow:hidden;'></div>";	var here = document.getElementById(name);	here.style.height = height+"px";	if (color!="null") here.style.backgroundColor=color;}function growBar(x,y,height,width,color,bcolor,name,inside){	var here=document.getElementById(inside);	if (inside!="already")	{		here.innerHTML+='<div id="'+name+'" style="position:absolute; overflow: hidden; background-color: '+color+'; border: solid; border-width:1px;border-color:'+bcolor+';top: '+y+'px;left: '+x+'px;width: '+width+'px;"></div>';	}		var here=document.getElementById(name);	if (here.style.height != (height+"px"))	{		var cur=0;		var b = here.style.height;		var temp = new Array();		temp = b.split('p');		cur=temp[0];		cur++;		here.style.height = cur+"px";		timer= setTimeout('growWait('+x+','+y+','+height+','+width+',"'+color+'","'+bcolor+'","'+name+'","'+inside+'")',1);	}}function growWait(x,y,height,width,color,bcolor,name,inside){	growBar(x,y,height,width,color,bcolor,name,"already");}

<html><head></head><body><div id="main"></div><script src="js.js"></script><script>initgraph(0,0,700,700,"null","graph", "main");growBar(30,180,200,50,"#454545","blue","b","graph");growBar(180,130,400,30,"yellow","blue","b2","graph");</script></body></html>

Enjoy! it will soon be on SourceForge.net

Link to comment
Share on other sites

Ya i am uploading it on GeoCities....wait a secondhttp://www.geocities.com/psaxena_17/html.html Here it is..I know it is very simple to make but I have just started making it so please dont laugh..I am making it so that I can make graphs with a spreadsheet web based app that I have made

Link to comment
Share on other sites

mootools is totally great man...but it is made by MIT people..my library even after completion would be no match for that, I am just in high school and learnt JS by myself and W3schools

Link to comment
Share on other sites

The license was created by MIT http://en.wikipedia.org/wiki/MIT_License. THe coders are not from MIT. Mootools was created by an Italian web company, http://mad4milk.netSome of the top javascript people are just regular people not super genuises. Take Dean Edwards for example http://dean.edwards.name. He runs his blog/dev site from a server nect to his fridge in his kitchen in UK. He is an average person with a passion for JS and looks to improve his code.As you read about coding and discover new techniques your code will improve. If oyu keep at it you could easily produce the same quality code. It just takes time.

Link to comment
Share on other sites

Hmmm...sorry about that, I thought that the MIT license was given only to MIT people. Mad4Milk website is very nice to look at, very nice interface. What is the difference between GPL and MIT license? According to you, should I release my Library(whenever I do) with the GPL or MIT license?

Link to comment
Share on other sites

Ha haSafe Looping :)

Link to comment
Share on other sites

See this added a new feature Animated Menu, I saw this at MooTools.net so decided to make it. Here is the JS File!So what do you think?

Link to comment
Share on other sites

Hmmm...sorry about that, I thought that the MIT license was given only to MIT people. Mad4Milk website is very nice to look at, very nice interface. What is the difference between GPL and MIT license? According to you, should I release my Library(whenever I do) with the GPL or MIT license?
I never noticed that mootools had the MIT license until you pointed it out. GPL is the most common.
Link to comment
Share on other sites

I never knew that an MIT license existed until I went to MooTools....for the time being I am using the MIT one only -

Copyright © 2007 Prateek SaxenaPermission is hereby granted, free of charge, to any personobtaining a copy of this software and associated documentationfiles (the "Software"), to deal in the Software withoutrestriction, including without limitation the rights to use,copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom theSoftware is furnished to do so, subject to the followingconditions:The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIESOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE ANDNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHTHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISINGFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OROTHER DEALINGS IN THE SOFTWARE.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...