Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Mrs. Wynand
Nov 23, 2002

DLT 4EVA
Any of you actually using node in something approximating a production environment?

I just ran into the joy of error handling. As far as I can tell, any sort of global errors events (e.g. mongoose.on('error')) as well as thrown exceptions outside a response processor (e.g. express.js routes) will either kill your process (and all its connections with it) or you can ignore the, which does new and interesting things depending on the error (mongoogse for example will either retry on error if it happened to be doing something model realted, or simply forget to breathe and stop firing any and all callbacks for ever (including error callbacks)).

Basically there's no 'top level' request scope you can unroll into, nor can there be a global 'current request' state to send an error into. The most reasonable scenario seems to be to just hope to god you have a local error callback you can use most of the time, and process.exit(1) in all other cases. You then need a supervisor to restart any failed nodes and maybe re-render their stderr as 500s or god knows what. It's about at this point that I began to ponder why exactly anyone thought this was ok to begin with.

Adbot
ADBOT LOVES YOU

Peanut and the Gang
Aug 24, 2009

by exmarx

I found this deep within the docs one day. You won't have any access to the scope, but at least you can log a backtrace without the process dying.
code:
process.on('uncaughtException', function(err){
  //do stuff
});

Peanut and the Gang fucked around with this message at 14:20 on Sep 21, 2012

Mrs. Wynand
Nov 23, 2002

DLT 4EVA

barbarianbob posted:

I found this deep within the docs one day. You won't have any access to the scope, but at least you can log a backtrace without the process dying.
code:
process.on('uncaughtException', function(err){
  //do stuff
});

But you can't just answer your request with a 500 either. In fact, you can't do anything with your requests (ALL requests for that process) - your server has still crashed, you just have an opportunity to do some cleanup before... well what can you do? You basically might as well crash and restart.


I ended up going with a cluster based supervisor that maintains its own forks and manages restarts. All connected requests will still see a dropped connection though. I don't think there's any way of solving that except an even more ridiculous node.js front end to the other cluster front end...

Peanut and the Gang
Aug 24, 2009

by exmarx
Oh, I assumed you had nginx or something on port 80 that routes the requests to node. If node doesn't respond for a certain amount of time, nginx will give a 500 for you.

On an error, you know the process is unstable, but with uncaughtException at least you can tell the cluster to stop sending requests to that process, and then wait a second or two before making the process kill itself. If the error isn't a horrible thing like mongoose exploding, the other requests will have a chance to finish before the process is terminated.

But this is only helpful if the process is still slightly stable and can finish the other requests. It'll be best in helping you find bugs in your code that throw errors. For instance I was having trouble when accessing item.id would through an error when item was undefined. This error would crash the whole process even though its only the one request that had a problem. So I just caught it with uncaughtException, logged it, made that request 500, and let everything else keep going.

LP0 ON FIRE
Jan 25, 2006

beep boop
My issue I had with krpano's map seems to have been magically solved in iOS 6, along with some bad things.

Datasmurf
Jan 19, 2009

Carpe Noctem
I work in a local newspaper, and today the IT person came and asked me if I knew a way to make a "Set this page as your homepage" button or link, so that we could have one on our page for the 'common people', as she so delicately frased it.

All I've been able to find, has been JS that only works in IE or is horribly outdated (from 2002 and those days).

I need to get this to work with all browsers. Is it even possible with Firefox, Chrome and Opera?

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
No. Why would it be?

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope
Yeah, you should just tell her exactly that. It's horribly outdated and browsers don't support it for security reasons.

Although, knowing the current browser trends, some kind of "bookmarks api for html5" might appear at any moment :v:

Datasmurf
Jan 19, 2009

Carpe Noctem
Ha ha, yeah. I told her that, but they want it anyway. And now she said that we should just stick with the one for IE, since 80% of our traffic comes from people using that horrible, horrible browser. Anyway, thanks for the "help". :)

Kallikrates
Jul 7, 2002
Pro Lurker
Whats the best practice for handling static json?
I have a file of several dozen objects of various types. at the start I was sending an ajax request to the json file. but That doesn't seem right, and was a pain for local development. I'm thinking I should just include the file. But I guess I want to confirm this from people who do this stuff for more than just hobby projects.

Suspicious Dish
Sep 24, 2011

2020 is the year of linux on the desktop, bro
Fun Shoe
More specific information would be nice. Do you want to load all the JSON objects up-front? Simply bundling them into a variable and adding it to the top of your would probably be easiest. Or put them in a separate file, and write something like this:

JavaScript code:
dataLoaded({ "one": "a", "two": "b" });

Fluue
Jan 2, 2008
I'm having some trouble with a project I'm working on. The end goal is to make a text adventure game that keeps score and is, obviously, location aware.

I'm having trouble adding more locations outside of the 4 initial locations I already have. The javascript is failing to recognize my global variable of "currentLocation" and when using an if command, it also causes the score to not update.

Here is my javascript on GitHub:
https://github.com/verkaufer/TextAdventureGame/blob/master/script.js

(Yes, I know that switch statement is ugly. I'll be cleaning it up later).

Where am I going wrong with my global var and condition checking?

dizzywhip
Dec 23, 2005

It's because you're using the var keyword on your local assignments to currentLocation. Instead of var currentLocation = "northendLibrary"; do currentLocation = "northendLibrary";. The former will create a new local variable that shadows the global one.

Edit: You're also doing this: hasVisited("northendLibrary" === true) when I think you mean this: hasVisited("northendLibrary") === true but should really just be this: hasVisited("northendLibrary").

dizzywhip fucked around with this message at 21:07 on Sep 29, 2012

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Fluue posted:

I'm having some trouble with a project I'm working on. The end goal is to make a text adventure game that keeps score and is, obviously, location aware.

I'm having trouble adding more locations outside of the 4 initial locations I already have. The javascript is failing to recognize my global variable of "currentLocation" and when using an if command, it also causes the score to not update.

Here is my javascript on GitHub:
https://github.com/verkaufer/TextAdventureGame/blob/master/script.js

(Yes, I know that switch statement is ugly. I'll be cleaning it up later).

Where am I going wrong with my global var and condition checking?

Before this project gets too big, it could be wise to start using jQuery and maybe some other library, like underscore.
Writing code like document.getElementById('score').innerHTML = score instead of $('#score').html(score) gets old pretty fast.

Also making sure the code goes through jslint or jshint without errors will probably make long-term development easier.

You are using a debugger, right?

Fluue
Jan 2, 2008
Gordon Cole was right -- I just forgot to close some parentheses.

Wheany - I'm using Firebug w/DOM view as my debugger right now. Do you have a suggestion for a better one?

Strong Sauce
Jul 2, 2003

You know I am not really your father.





Kallikrates posted:

Whats the best practice for handling static json?
I have a file of several dozen objects of various types. at the start I was sending an ajax request to the json file. but That doesn't seem right, and was a pain for local development. I'm thinking I should just include the file. But I guess I want to confirm this from people who do this stuff for more than just hobby projects.

I'm assuming on the client side? Why not just assign the JSON to a variable and then load the file containing the JSON?

Yeah I would just load it through another file. Better if you have something that stitches files together so you don't have that load delay. Not sure if there is a "better" solution but its better than loading it via AJAX.

Strong Sauce fucked around with this message at 09:49 on Oct 1, 2012

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Fluue posted:

Wheany - I'm using Firebug w/DOM view as my debugger right now. Do you have a suggestion for a better one?

No, I was just worried that you would be debugging by alert() ing variables instead of setting breakpoints and watching variable states.

some kinda jackal
Feb 25, 2003

 
 
Can anyone recommend a book that gives someone a good foundation in node.js while teaching javascript at the same time?

I'm interested in the technology but only have a passing familiarity with javascript from when I did web dev 7 or 8 years ago. Needless to say I would probably be learning most of the language from scratch.

Basically looking for enough to hit the ground running with node.js. Not looking to master the language off the bat.

Wozbo
Jul 5, 2010
I am literally in your shoes a month ago. Unfortunately I'm all self taught via API docs and whatever else I use.

I'm completely serious when I say ask me anything. I have done a whole site with an empty body (Literally empty, serving up dynamic content AND functions) and a combo of node and socket.io (a node lib if you will). Anything you ask will probably help me strengthen my knowledge too :)

But yeah, a lot of it is very confusing at first look. NPM is awesome, and will help you immensely, as there are so many stable libs nowadays (need mysql access with parameters etc? one command and you have it. LDAP? forget about it).

If you've ever coded at all, you can node pretty drat easily, you'll just have to wrap your head around closures and event emitters (which if you've ever dug deep into .Net and C# you will have most of the mental tools).

Seriously, ask me either in the thread or via PM, I'll get you started.

some kinda jackal
Feb 25, 2003

 
 
Awesome, thanks. I'm going through some O'Reilly Node material right now. No concrete project yet but I will probably be back to ask questions :)

Wozbo
Jul 5, 2010
I should probably get that book, I've done some crimes against nature myself, learning.

E: Like did you know: you can send functions and rebuild them over a socket via JSON?

Wozbo fucked around with this message at 02:23 on Oct 4, 2012

Clanpot Shake
Aug 10, 2006
shake shake!

I'm seeing some odd behavior with a little JS project I'm working on. I've got a dropdown containing 5 values, with the onchange event set to update a text field on the page by reading a value from a file server-side - it does this correctly, the value I'm expecting appears.

The value in the text field is a number that effects other fields on the page, so I need to update them too. I've got a function that iterates over all of the fields on the page and updates their values, so I call that after the file read function completes.

When the update function runs, it pulls the old value from the text field that the first update function changed, rather than its new one. How can I pull the new value, rather than the old one? I'm using document.getElementById.value to retrieve the value from each field, and given that it's not pulling the correct value I'm guessing this isn't the correct way.

karms
Jan 22, 2006

by Nyc_Tattoo
Yam Slacker
Show code.

Hoops
Aug 19, 2005


A Black Mark For Retarded Posting
Can I get some very, very basic introductory help with installing Java. I don't know a thing about computers. I've tried 4 different tutorials but they're all getting on my nerves because they just start talking about things I've never even heard of. It's maddening.

So: I have downloaded the Java Development Kit from the Sun website. I clicked "next" and all that through the installation process, without changing any directories at all.

1) I'm being told to download the Java SE API Documentation, which apparently is this. What do I actually download? That's a list of a hundred things that mean absolutely loving nothing. I'm losing my patience at these guides because they go into minute detail about stuff that someone would have to understand to even be reading the website, but the vaguest instructions on the actual stuff that computer-laymans don't know.

2) Once I have this API documentation, it says to unzip it into my Java home directory. I assume my Java home directory is the directory that I just installed that JDK in, which was C:\Program Files\Java

Once I have that, there should be a folder named "docs".

That's where I'm up to.

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



This here is the Javascript thread. Javascript actually has nothing to do with Java - it was named that way for marketing purposes (Java was supposed to be the Next Big Thing at the time).

Here is the Java thread: http://forums.somethingawful.com/showthread.php?threadid=2780384

That said, you probably don't need to download API docs if you can get to them in a web browser, so I don't know why that would be part of a guide at all.

Hoops
Aug 19, 2005


A Black Mark For Retarded Posting

Munkeymon posted:

This here is the Javascript thread. Javascript actually has nothing to do with Java - it was named that way for marketing purposes (Java was supposed to be the Next Big Thing at the time).

Here is the Java thread: http://forums.somethingawful.com/showthread.php?threadid=2780384

That said, you probably don't need to download API docs if you can get to them in a web browser, so I don't know why that would be part of a guide at all.
Cool, thanks. I'm really surprised at how inpenetrable some of these guides are, even the ones called "Installing Java for beginners" the like.

Clanpot Shake
Aug 10, 2006
shake shake!

Clanpot Shake posted:

I'm seeing some odd behavior with a little JS project I'm working on. I've got a dropdown containing 5 values, with the onchange event set to update a text field on the page by reading a value from a file server-side - it does this correctly, the value I'm expecting appears.

The value in the text field is a number that effects other fields on the page, so I need to update them too. I've got a function that iterates over all of the fields on the page and updates their values, so I call that after the file read function completes.

When the update function runs, it pulls the old value from the text field that the first update function changed, rather than its new one. How can I pull the new value, rather than the old one? I'm using document.getElementById.value to retrieve the value from each field, and given that it's not pulling the correct value I'm guessing this isn't the correct way.

Here's the code for this. base_field# defaults to 20 and is modified by +/-5, but when sumStats() finishes it uses 20 instead of 15/25.

XML
code:
<root schemaLocation="file:///schema.xsd">
	<baseline>
		<a1>20</a1>
		<a2>15</a2>
		<a3>25</a3>
	</baseline>
</root>
HTML
code:

	<form action="">
		<select class="ddselect" id="dropdown" name="dropdown" onchange="loadXML()">
			<option value="opt1" selected="select">Option 1</option>
			<option value="opt2">Option 2</option>
			<option value="opt3">Option 3</option>
		</select>
	</form>
	....
	<input class="attr" id="base_field0" disabled="disabled" type="text" size="1" value="20"><br/>
	<input class="attr" id="base_field1" disabled="disabled" type="text" size="1" value="20"><br/>
	<input class="attr" id="base_field2" disabled="disabled" type="text" size="1" value="20"><br/>
	<input class="attr" id="die_field0" disabled="disabled" type="text" size="1" value=""><input class="attr" id="die_field9" disabled="disabled" type="text" size="1" value=""><br/>
	<input class="attr" id="die_field1" disabled="disabled" type="text" size="1" value=""><input class="attr" id="die_field10" disabled="disabled" type="text" size="1" value=""><br/>
	<input class="attr" id="die_field2" disabled="disabled" type="text" size="1" value=""><input class="attr" id="die_field11" disabled="disabled" type="text" size="1" value=""><br/>
	<input class="attr" id="misc_attr1_0" disabled="disabled" type="text" size="1" ><br/>	
	<input class="attr" id="misc_attr1_1" disabled="disabled" type="text" size="1" ><br/>	
	<input class="attr" id="misc_attr1_2" disabled="disabled" type="text" size="1" ><br/>	
	<input class="attr" id="misc_attr2_0" disabled="disabled" type="text" size="1" ><br/>	
	<input class="attr" id="misc_attr2_1" disabled="disabled" type="text" size="1" ><br/>	
	<input class="attr" id="misc_attr2_2" disabled="disabled" type="text" size="1" ><br/>	
	<input class="attr" id="attr_0" disabled="disabled" type="text" size="1" value=""><br/>	
	<input class="attr" id="attr_1" disabled="disabled" type="text" size="1" value=""><br/>	
	<input class="attr" id="attr_2" disabled="disabled" type="text" size="1" value=""><br/>	
	
	
	
JavaScript
code:

function loadXML()
{
	var xmlhttp;
	var i;
	if (window.XMLHttpRequest)
	{// code for IE7+, Firefox, Chrome, Opera, Safari
		xmlhttp=new XMLHttpRequest();
	}
	else
	{// code for IE6, IE5
		xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	xmlhttp.onreadystatechange=function()
	{
		if (xmlhttp.readyState==4 && xmlhttp.status==200)
		{
			document.getElementById('base_field0').value=xmlhttp.responseXML.documentElement.getElementsByTagName("a1")[0].childNodes[0].nodeValue;	
			document.getElementById('base_field1').value=xmlhttp.responseXML.documentElement.getElementsByTagName("a2")[0].childNodes[0].nodeValue;	
			document.getElementById('base_field2').value=xmlhttp.responseXML.documentElement.getElementsByTagName("a3")[0].childNodes[0].nodeValue; 
		}
		sumStats(); // SHOULD BE HERE
	}
	xmlhttp.open("GET",document.getElementById('dropdown').value+'.xml',true);
	xmlhttp.send();
	console.log('done xml');
	sumStats();  // WRONG PLACEMENT
}
function sumStats()
{
	console.log('in sum stats');
	for (var i = 0; i<9; i=i+1)
	{
		var field = "attr_"+i;
		var d1 = document.getElementById("die_field"+i).value;
		var d2 =  document.getElementById("die_field"+(i+9)).value;
		var m1 = document.getElementById("misc_attr2_"+i).value;
		var m2 = document.getElementById("misc_attr1_"+i).value;
		var base =  document.getElementById("base_field"+i).value;
		
		document.getElementById(field).value=sumVals(d1,d2,base,m1,m2);
	}
	fillBonuses();
}
function sumVals()
{
	var sum = 0;
	var text = '';
	for (var i = 0; i < arguments.length; i++) 
	{
		text += arguments[i]+' + ';
		num = parseInt(arguments[i]);
		if ( isNaN(parseInt(arguments[i])))
		{
			num=0;
		}
		sum += num;
	}
	//console.log(text+' = '+sum);
	return sum;
}

e; solved my own problem, edited code.

Clanpot Shake fucked around with this message at 21:47 on Oct 4, 2012

Wozbo
Jul 5, 2010
IIRC you are dealing with instantiating an event and not doing processing after the event.

This line:

xmlhttp.onreadystatechange=function()

Doesnt block. It just assigns, and runs asynchronously. So you've already done processing by the time the thing is fully loaded. You need to call the whole sumstats when you have a readystate of 4 and the 200 OK, or you'll have happily gone on processing on the default value.

Unless I'm completely wrong and my lack of sleep is killing me.


E: goddamnit I was helping :( Let me help youuuuuuuuu!

E2: Also, you should probably do it inside the r=4 instead of outside, or you'll be doing pointless processing. I know its not much now, but in the future it might be, and god forbid your function makes side effects.

Wozbo fucked around with this message at 21:53 on Oct 4, 2012

some kinda jackal
Feb 25, 2003

 
 
Node best practice question:

Do you guys typically use nvm to manage your node instances or do you just download individual installers off nodejs.org or does it really not matter?

Wozbo
Jul 5, 2010
I use n, as nvm has broken for me on centos 6. just npm install -g n then n stable (or discrete version if you like). Any time you run n all the global links get updated too and everything else gets put into some versioning folders. so n stable will get 0.8.11 (I think?), compile it, move any current node stuff to a directory marked by whatever node -v returns, and then moves the compiled version out to the proper spots and you can just node <whatever>. You can also do something like n <version> <whatever> and it'll do the whole download compile whatever, and I don't think it moves anything but uses that version to run your js file. It's pretty nice :)

E: You will need sudo or be root

Wozbo fucked around with this message at 13:22 on Oct 5, 2012

some kinda jackal
Feb 25, 2003

 
 
Interesting. I'll give that a look. I'm not too concerned about it, but I wanted to get off on the right foot.

I really wish there was a "learn javascript for node" resource, instead of making me trudge through chapters and chapters of client side javascript. I suppose it'll be good to learn for HTML5 anyway, but I can't help but feel disappointed that there isn't a book (that I've found) that concentrates on Javascript 101 for Node development.

abraham linksys
Sep 6, 2010

:darksouls:
I mean, java script: The Good Parts (http://www.amazon.com/JavaScript-Good-Parts-Douglas-Crockford/dp/0596517742/) is basically the K&R of JavaScript. It's slim, teaches you best practices in a language full of bad ones, and barely even touches on the DOM (i.e. browser scripting).

From there, you'll have to find your own book for learning Node (not that there's a ton to learn, once you figure out events and callbacks), but that's what I'd use for learning JS, especially if you're coming from another language.

some kinda jackal
Feb 25, 2003

 
 
Awesome, thanks!

There are a TON of Node resources, but most if not all all assume you've been raised on client side browser JS.

thathonkey
Jul 17, 2012
Tagging onto the Node convo: I program in JS in the browser professionally and it is probably the language I'm most comfortable with and I want to get into Node. I've done server-side programming and database stuff before, mostly PHP but a little bit of JSP and then on the database end I've worked with various SQL flavors and also CouchDB on the noSQL front. So that is my background. I prefer to learn from books, but after poking around Amazon a little bit last night I didn't see anything that looked like it was worth any amount of money. Can someone here recommend a good Node resource online or book for someone who is already well-versed in clientside JS?

Safe and Secure!
Jun 14, 2008

OFFICIAL SA THREAD RUINER
SPRING 2013
So I've been using require.js for one small project of mine, and it has been helpful. But now I'm looking at starting a new project where I'll be using node.js and multiple Javascript libraries instead of writing everything I use myself, and I'm wondering if using require.js is going to be more trouble than it's worth from here on out.

I imagine most people aren't using require.js. How are they managing dependencies?

Maluco Marinero
Jan 18, 2001

Damn that's a
fine elephant.

Safe and Secure! posted:

So I've been using require.js for one small project of mine, and it has been helpful. But now I'm looking at starting a new project where I'll be using node.js and multiple Javascript libraries instead of writing everything I use myself, and I'm wondering if using require.js is going to be more trouble than it's worth from here on out.

I imagine most people aren't using require.js. How are they managing dependencies?

I'm personally using head.js with the project I'm currently working on. Once I got the kinks out it worked well with the AngularJS app I'm making, delaying the services until the local database object is good to go. This is a client side project only.

Khorne
May 1, 2002

Safe and Secure! posted:

So I've been using require.js for one small project of mine, and it has been helpful. But now I'm looking at starting a new project where I'll be using node.js and multiple Javascript libraries instead of writing everything I use myself, and I'm wondering if using require.js is going to be more trouble than it's worth from here on out.

I imagine most people aren't using require.js. How are they managing dependencies?
Require.js is pretty much the go-to preexisting solution for managing dependencies right now. You are already using it so I assume you are over the larger learning curve it has to alternatives as well. It's often mislabeled as a script loader. That functionality isn't a real draw, because you should be using optimizer to get everything in to one (or two) script files anyway.

The worst things I have to say about require.js is it's somewhat tedious to have to declare dependencies all the time and the way you declare dependencies doesn't play nice with IDEs. The former isn't an issue for larger projects, but it's a reason to steer clear of require.js for something like a wordpress site or a tiny one page app. Something like yepnope is simpler and more appropriate there.

edit: On the node side of things, this page has some information about making it less of a hassle. Admittedly I have not got around to doing any projects using node yet. Hopefully someone else can chime in on that end. I would likely just have client and server code be somewhat different and use node's dependency manager server side with require on the client.

Khorne fucked around with this message at 23:49 on Oct 7, 2012

Uziel
Jun 28, 2004

Ask me about losing 200lbs, and becoming the Viking God of W&W.
I'm trying to warn/prevent a user when they close a page only if they have unsaved data.

This fires every time:
code:
<head>
<script type="text/javascript">
        function closeIt() {
           
          return "You currently have unsaved pending mods.";
            
        }
        window.onbeforeunload = closeIt;


</script>
</head>
The condition for there being "unsaved data" is if the count of nodes in an ext.net treepanel other than root is greater than 0.
code:
<head>
<script type="text/javascript">
       function closeIt() {
            var count = 0;
            tpMods.getRootNode().cascade(function (node) {
                if (!node.hidden) {
                    count++;
                }
            });
            if (count > 0) {
                return "You currently have unsaved pending mods.";
            }
        }
        window.onbeforeunload = closeIt;
</script>
</head>
This doesn't work and I'm confused as to where to go next. Do I need to set some global variable for the count that is updated when the treepanel is? Any ideas?

dizzywhip
Dec 23, 2005

Doesn't work in what way? Does it cause an error? Does it not warn the user at all? Does it warn them every time? Is tpMods defined in this context?

Adbot
ADBOT LOVES YOU

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Uziel posted:

code:
<head>
<script type="text/javascript">
       function closeIt() {
            var count = 0;
            tpMods.getRootNode().cascade(function (node) {
                if (!node.hidden) {
                    count++;
                }
            });
            if (count > 0) {
                return "You currently have unsaved pending mods.";
            }
        }
        window.onbeforeunload = closeIt;
</script>
</head>
This doesn't work and I'm confused as to where to go next. Do I need to set some global variable for the count that is updated when the treepanel is? Any ideas?

Try putting a breakpoint on the first row of closeIt (var count = 0).

Does the breakpoint ever trigger?

What is the value of tpMods when paused on the above breakpoint?

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply