« first day (9 days earlier)      last day (4940 days later) » 

5:01 PM
@Tom Well, most of the developers involved with the project insist that it's very dangerous to use in production, and people who use it for prototyping and "research" work say it crashes all the time
 
You can find the list of company using node.js on that page
 
@HoLyVieR I'd like to see what value the 'checkyo' variable has in Firefox.
 
is it possible to call a function fnA() defined (within script tags) in page1.jsp from page2.jsp?
 
@EtonB Have you tried Firebug ?
 
The reason I asked was because I have found JavaScript confined to the web; and has never really caught on as a full fledged scripting / programming language outside it. Comparing it to perl or python. Node.js looks like the first project which is gaining a bit of traction
 
5:04 PM
It's still fairly new, I dont think the API is finished yet
 
@vivekian2 Rhino is used in the Java world a lot - in fact there's a complete server framework built on it
 
@Pointy what is that framework called?
 
@vivekian2 I'm trying to remember - the oldest one is "Helma", but there's a derivative of that out now - it's cool because you can find Google app engine support for it
 
@Pointy interesting; i will keep a look out for it. i hope node.js does well in the future.
 
is it possible to call a function defined in page1.jsp from another file page2.jsp - both in the same project?
 
5:07 PM
@HoLyVieR makes sense.
 
@Pointy: RingoJS? It's the "next generation" of Helma (used to be called Helma NG)
 
@MatthewCrumley yes that's what I was thinking of - it's unpalatable for Java-haters, but getting the massive JVM runtime to exploit (esp. DB support) makes it pretty powerful
 
im here
 
@HoLyVieR I'm trying to use it but I don't know how to see a javascript variable's value
 
Tom
Pointy, vivekian, I've used node.js for some crawling applications and never had any problems with it crashing. I know Yahoo is working on using it as their mail backend and there are already some (admittedly not too commonly known) websites hosted with node as the webserver
 
5:11 PM
@Pointy Yeah, I've been playing around with it and it's worked pretty well for me.
 
@EtonB If your variable is global, you can just type the name of the variable in the console and it will show the value
 
@MatthewCrumley Can you tell whether it uses Rhino packaged separately from the JDK? The Rhino version in the JDK (6) is ridiculously old
 
otherwise if it's the code, you can add breakpoint and you will be able to see the value
 
@Pointy Yes, it comes with it's own Rhino engine. It's a slightly modified/enhanced version of 1.7
Specifically, it includes parts of ECMAScript 5 like Object.create, JSON, etc. plus the simpler expression closure syntax from 1.8
 
@Tom thats encouraging
 
Tom
5:19 PM
@vivekian, I think so too, my biggest problem is the language Javascript, not node.js
Mostly because I'm used to an object oriented design
There does seem to be a lack of resources discussing the various design strategies used for big javascript applications
 
@Tom you can do OOP in Javascript, it's just that it's in an uncommon way
 
@Tom i see; i have never delved into it much myself. But I think there are a couple of good books out there now which can be helpful: Pro JavaScript Design Patterns is one.
 
Tom
@HoLyVieR, I think so yes, I'm just not sure what the proper setup is to do OOP in Javascript, lots of my concerns I described in stackoverflow.com/questions/4008766/…
@vivekian2, hmm interesting, thanks
 
As Douglas Crockford says: "JavaScript is really a nice language once you get rid of the bad parts"
 
@Tom this is another new book which has come out: amazon.com/JavaScript-Patterns-Stoyan-Stefanov/dp/0596806752/…
 
Tom
5:24 PM
Jacob, probably, would be nice to have a 5 mins install framework that'd get rid of the bad parts ;)
Thanks vivekian, looks like the first book is available digitally for free, books.google.co.uk/…
 
@Tom Yeah. Have a look at the ES5 spec.
 
Why's the attributes property of a control different on IE and Firefox? :(
 
@Tom not the entire book; but yes some parts are free.
 
Tom
vivekian, I will probably order it. still surprises me there's not much available online though
 
Ben
5:40 PM
So, one of my professors says that JS files should be included on the head for a "better performance". He also said that JS the server because the validations are done in the client. I know, at least I think, that both of them are false statements, but before I opened my mouth I wanted to be 100% sure, are they?
relieve*
 
Tom
" JS the server" ?
 
Ben
relieve, sorry
 
Well if you put javascript file in the head, they will load up before the rest of your content. If you don't need to execute any javascript before the pages load you should put them at the bottom of the body
You can use that link as a reference
 
@Ben Well, in some browsers where JS is loaded async it'll make the JS finish loading quicker (as it starts sooner), but in others where JS blocks parsing, it'll make the rest of the page load slower. Validation has to be done server-side too, because the client can send any evil content, esp. if it starts not executing Js.
 
@HoLyVieR - It depends on the context of the application as to whether that has as much merit in today's browsers.
 
Ben
5:49 PM
which of today's browsers load JS async? I thought all of them blocked the parsing as the JS might contain markup manipulation used after
 
I'll say one thing now. wedontsupportie.com
 
@Ben with the defer attribute, nearly every browser can load javascript asynchronously
 
@Ben WebKit and Gecko do, though they potentially throw away what they've parsed/loaded on later in the document given certain types of document.write
 
@Jacob I wish, I could do that, but it pratices you just can't do that.
 
Tom
Jacob, you don't support most of your visitors?
 
5:53 PM
 
I don't care
 
"Hey, let's dictate to everybody what browser they should use"
 
If my users are stupid enough to use IE, then I don't want to have them as customers.
 
@Tom FWIW, I have some sites (with non-trivial numbers of hits) where IE is around 25%
 
Tom
Though I do agree that IE is a real hassle, especially when it comes to Ranges
@gsnedd
oops.
 
5:55 PM
(Yeah, I know that's not true in general, but there are sites where it wouldn't be suicide.)
 
@JacobRelkin you have to remember that (especially in business) not all decisions are choices, many are a lack of options :)
2
 
Tom
@gsnedders, I know, doesn't surprise me for the more technical websites - but the average visitor still uses IE
 
(Oh, down to 10% nowadays)
 
I have this:
<div id='showR".$show['id']."'></div>
with:
$('#showR' + commentID).html('Removed');
is this right?
 
(And only 1% IE < 8, which means practically it wouldn't be that bad)
 
5:57 PM
@NickCraver Yeah. But the time spent on making it work in IE just doesn't pay off most of the time for me personally.
 
@user457827 you're missing some PHP tags
 
and that's a fair case, it's just not a choice the vast majority of devs can make
 
@HoLyVieR i got this in a echo already, just unwrapped it for you
 
@user457827 what's wrong with it ?
 
@user457827 that should work, as long as the commentID variable is the same number
 
5:58 PM
@NickCraver That's true, but as more and more devs refuse to support IE, eventually the rest of us will have to worry less and less.
 
@tpae can't get it to work. Do i need to style display: none to the div maybe ?
 
@user457827 your $('#showR' + commentID).html('Removed'); needs to be wrapped around an event.. did you do that?
 
@user457827 What do you mean by "can't get it to work"
 
@tpae Yes, its in a ajax success
@holyvier nothing appears
 
@JacobRelkin not just dev time - for complex RIAs the "IE6 version" basically requires its own QA and possibly its own design
 
6:00 PM
@sworoc - perhaps I was too ambiguous, it's often a monetary decision outside the purview of any developer, e.g. a large corporation that won't upgrade because their intranet apps were never close to having valid markup.
 
@user457827 try debugging with alerts, inside ajax success. see if the ajax call was successful
 
@Nickcraver nice quote.
 
@user457827 then we can narrow it down whether it's ajax problem or jquery problem..
 
@tpae I have another $comment.hide().remove(); in the success that works fine
 
@NickCraver totally agree Nick - the "IE6 people are dumb" really ignores how complicated and expensive are huge IT projects like upgrading 50,000 workstations/laptops, esp. given craptastic IE-only "enterprise" intranet apps
 
6:01 PM
@user457827 have u tried alerting commentID? does that work?
 
@tpae two seconds..
 
Ben
@sworoc You can't do that. Imagine making a bank web app, you can't just throw in there "use chrome", all the grannies who bought a PC with windows preinstalled will be like "wtfis chrome"
 
Very true, I guess companies will go the Google route and just install a plugin for everything that IE doesn't do right out of the box, until it becomes a terribly slow modern browser.
 
@tpae works fine, i get the id.
 
Hello all, do you mind if I ask a quick question?
i'm not sure if there is a rotation or something
 
6:02 PM
ask away
 
I'm working with jQuery's find() method and replaceWith() function
they aren't behaving the way I want them too
here is an example
$(editorText).find('span.'+name).replaceWith('{{html '+name+'}}');
editorText is HTML from a text area
 
I guess there's something to be said for working for an engineering company where the attitude is basically, "you're in charge of your own workstation, you must run anti-virus if you use Windows (here's the anti-virus software you're required to use), and you're not allowed to use certain programs x, y, and z with bad security records"
 
@tpae just checked if the div is there, and it is right located <div id='showR505'></div>
 
@whobutsb My guess is that you want to replace the original span?
 
yes
 
6:04 PM
@user457827 interesting..
 
I can post more from my function if needed
 
is your find returning the element you are expecting it to?
 
yes it is
 
Tom
Anyone here considers it bad practice to separate each class in its own file when attempting to do OOP in javascript?
 
@tpae alot.. double checked, although i may think where the problem is
 
6:05 PM
[<span class="RestaurantName">Blackstone Caterers</span>]
which I would like to replace the entire span with: {{html RestaurantName}}
 
@tpae see $comment.hide().remove(); is also in success and $comment is: $comment = $this.closest('div');
 
Ben
@gsnedders Well, unless you download porn at work or download any of those "download me and get 1 million dollars" programs, I don't see the need for an anti-virus
 
@tpae and after this input delButton (that this code is in), there is my div
 
@Ben Bah, you mean you don't browse porn at porn? Pff!
 
@user457827 hmm... have you tried commenting that line, then try again?
 
6:07 PM
@tpae good one.. 2 sec
 
@whobutsb I haven't made use of replaceWith before, perhaps some of the others have, but I would do an .after(html).remove()
 
i'll try that now
 
@tpae just did, now it displays!
 
Ben
with the advent of live streaming you don't need downloads :P, but no I don't.
 
@swo
@sw
 
6:08 PM
heh
 
sorry trying to figure out the @ command
 
@Ben Obviously you need to get a job where it's part of it. ^-^
 
i'm still getting the same results
 
@user457827 nice. :)
 

Sandbox

Where you can play with regular chat features (except flagging...
 
6:09 PM
@sworoc think I need to add: editor =
editorText = $(editorText).find('span.'+name).after('{{html '+name+'}}').remove();
 
How would you go about building this: imagebin.ca/view/BzROBz4.html
 
hmm doing that returns: [];
 
@tpae thank you.. i got an quick question
@tpae how to know what´s the closest div ?
@tpae if it is $('div#commentList input.delButton') then the div after commentList is the closest or?
 
@user457827 what you did is right, i think... $(this).closest('div')
 
@whobutsb what does it look like without the remove?
 
6:12 PM
@tpae could you just confirm what i wrote on the last line is true?
 
@sworoc same thing: [];
 
@user457827 yes, from what I can tell. make sure it's not the parent or child, but the div after it
 
thats the output in the console for:
editorText = $(editorText).find('span.'+name).after('{{html '+name+'}}');
 
that's because you're getting a jQuery object back
 
@tpae you mean inside the commentList?
 
Tom
6:13 PM
FYI: I created a node.js javascript OOP design structures discussion chat room (chat.stackoverflow.com/rooms/215/…) for anyone interested
 
@whobutsb - what is editorText? it's not finding an element with a <span class="name"> (whatever name is) inside.
 
@tpae the closest div is inside the commentlist. My input delbutton get hided while the rest inside the same div doesnt.. that's my issue and thats why i implented the text instead..
 
editorText is HTML coming from a CKEditor
 
if <span> is a root level element in your created dom fragment .find() won't work, you'll need .filter()
 
var editorText = ckeditor.ckeditorGet().getData();
 
6:15 PM
@whobutsb - for this example, what is that value?
 
@user457827 hmm.. it shouldn't be too complicated, do you have a small sample code?
 
@tpae but if you could help me solve hiding the rest inside the closest div, would be great.. can't find where it goes wrong.
@tpae Although the code works fine for the not-ajaxresponsed stuff
 
<p>
</p>
<h2 style="text-align: center; ">
<span class="RestaurantName">Blackstone Caterers</span> Invoice</h2>
<p>
</p>
 
@user457827 traversing through different elements, i usually use $(this).parent().find('div'), or use $(this) and class selectors
 
what is name in that example?
 
6:16 PM
For the sake of this chat i truncated all the output
name = 'RestaurantName'
 
when you said you wanted to replace it, you want the new element inside the h2?
 
@tpae hmm
 
@user457827 setting class selectors, and try using $(this).parent().find('.class')
 
No to replace the span
so it would look like:

<p>
</p>
<h2 style="text-align: center; ">
{{html RestaurantName}} Invoice</h2>
<p>
</p>
 
ok I think I understand the confusion here, $(editorText) doesn't change the existing element, you're creating a new document fragment, elements with that markup....you're not performing operations on the editor itself but on a separate set of elements not really related
 
6:18 PM
@tpae im confused alittle, whats class selectors ? class="" .. ?
 
ah that would make sense
 
@user457827 yes. <div class="test"></div>, then use $(this).parent().find('.test').html("Removed!");
 
@NickCraver good catch, I agree.
 
@NickCraver how would I set it to update editorText?
 
@user457827 it's easier to find certain divs that way
 
6:20 PM
@tpae testing
@tpae couldn't get it to work. I have it inside <div id="commentList"
 
@whobutsb - though CKEditor's functions, you could for example do $('<div />').append(editorText).doStuff(....) then grab the .html() from that same fragment, use that value (the new html) to set the editor's contents
 
@user457827 could you construct a sample code? would help me to help you better
 
e.g. var newHTML = $('<div />').append(editorText).find('span.'+name).after('{{html '+name+'}}').remove().end().html();
 
oh wow
let me try that
 
@tpae ok seconds
 
6:25 PM
@NickCraver oh so close!
So i'm going to add one more monkey wrench in to the mix
i'm doing it in a loop
var editorText = ckeditor.ckeditorGet().getData();

var newHTML;

$.each(templateTags, function(name, val){
newHTML = $('<div />').append(editorText).find('span.'+name).after('{{html '+name+'}}').remove().end().html();
});

console.log(newHTML);
BINGO!
var editorText = ckeditor.ckeditorGet().getData();

var newHTML = editorText;

$.each(templateTags, function(name, val){
newHTML = $('<div />').append(newHTML).find('span.'+name).after('{{html '+name+'}}').remove().end().html();
});

console.log(newHTML);
@NickCraver & @sworoc THANK YOU VERY MUCH
 
@tpae jsbin.com/ucevi/edit Here is it. Ok what i originally want is that status$id to hide, and not just the button only(don't know why it does that, when i activate the $comment.hide().remove(); )
 
var editorText = ckeditor.ckeditorGet().getData(), temp = $('<div />').append(editorText);
$.each(templateTags, function(name, val){
  temp.find('span.'+name).after('{{html '+name+'}}').remove();
});
console.log(temp.html());
something like that should optimize it a bit more
 
Perfecto!
 
@user457827 let me clarify, so on click of the button, you want the whole div to hide?
@user457827 when they click delButton, the status$show['id'] div becomes hidden?
 
@tpae yes, the status$id div.
@tpae No, when i click the delbutton when $comment.hide().remove(); is uncommented, only the input button becomes hidden.. that's whats weird?
 
6:34 PM
@user457827 try using parent selector. $comment.parent().hide().remove();
 
@tpae ok trying
 
Anyone get the "Script Stack Space Quote is Exhausted" when running JQuery and Microsoft Templates? Anyway to increase the quota with a preference or something?
 
@tpae awesome!!!
 
@user457827 :)
 
@tpae how.....could you know?
 
6:39 PM
@user457827 know what? the problem?
 
@tpae I want to understand how, so I dont make this mistake again, $comment.parent().hide().remove(); , so it´s the closest div in parent ?
@tpae parent means inside commentList ?
 
@user457827 parent selectors are usually used like this: <div class="parent"> <div class="child"><input type="button" class="me"></div> </div>, and when you call $('.me').parent().html("blank");
er
well, to be simple
it's outer level of the div
 
@tpae Thank you, just made it more harder for me :-D
 
@user457827 sorry, 1 sec
 
.parent() refers to the immediate parent of the clicked element when you're going from this in a click handler
 
6:42 PM
So if you do $('.me').parent().html("blank"); , it comes in class=parent
 
@NickCraver is right... im suck at explaining things
 
Ok wait
 
nope, it changes the parent's innerHTML to "blank"
 
what's the difference?
 
if you wanted to search for a parent, say one that had class="container" you'd use .closest(), like this: $(this).closest(".container")
 
Ben
6:44 PM
I'm getting inbox hits from another user named 'Ben' =/
Guess I'll change that
 
@user457827 - the .parent() method (unless you give it a selector) doesn't care about classes at all
 
<div class="parent">
<div class="this">
<div class="child">
BEEH
</div>
</div>
is this right?
forgot an </div> whatever
confirm someone if this is right names
 
Ben
If you give .parent() a selector that isn't correct does it return the original element?
 
@Ben you mean, when the this div is the outer element? i believe it returns the document..
outermost*
 
@Ben - .parent(selector) return only the immediate parent if it matches the selector
it'll be an empty jQuery object otherwise
 
6:48 PM
could someone clarify
 
@user457827 - this refers to the current element, it has nothing to do with classes
 
Ben
I mean taking user457827's example, will $('.child').parent('.this') return an empty object or $('.child)?
 
$(".this") would refer to class="this", but $(this) refers to the current context, usually an element when inside an event handler
 
@user457827 returns $('.this')
 
@Ben it'll return an empty jQuery object
 
6:49 PM
We're misunderstanding alittle
 
@user457827 you are right on the syntax.
@user457827 parent > this > child
 
Hello everyone
 
@tpae yes exactly!
@tpae that's what i wanted to know
 
hi joslinm
hi joslinm
 
@joslinm - hilo
 
6:50 PM
@tpae if im inside class=this, then i would use child() to get class=child ?
@tpae lagg
 
@user457827 sometimes if you want to go higher up, use .parents('.selector')
 
wow, did it just double post?
 
@user457827 yes.
 
@tpae - Usually you don't want .parents(), use .closest() unless you want not-the-nearest parent
 
I wanted to know if something like
$(#selector tbody tr:last).insertAfter("<tr><div>hi</div></tr>");
is valid inside of jquery
 
6:51 PM
@NickCraver heh.. i see.
 
When I tried it last night, I kept getting just an empty 'tr' inside the first tr
 
@tpae so if im inside class=this, i would use child() to get to class=child ?
 
@user457827 - a) please change your name, autocomplete is painful :), b) no, that's incorrect, .parent() has nothing to do with class="parent" .anything() has nothing to do with class="anything", they're different concepts
.parent() is referring to the method .parent(): api.jquery.com/parent
 
@nickcraver no no no
@nickcraver not what i mean i know the methods
@nickcraver let me do another example, sorry for the name :P
 
Anyone has ever done a Comet implementation, that uses the <script> tag instead of XHR ?
 
6:53 PM
@joslinm - you want .after(): $("#selector tbody tr:last").after("<tr><div>hi</div></tr>");
 
@nickcraver
<div class="1">
<div class="2">
123
<div class="3">
</div>
</div>
</div>
@nickcraver if im holding on coding event for class="2"
 
.insertAfter() is the reverse: $("<tr><div>hi</div></tr>").insertAfter("#selector tbody tr:last");
 
@nickraver then i would do child().hide(); to hide class="3" ?
 
@joslinm why not use $('#selector tbody:last').append('<tr><td>blabla</td></tr>');
 
@nickcraver and parent().hide(); to hide class="1" .. ?
 
6:54 PM
Append is different than after
 
@user457827 - .children().hide() would yes
 
@NickCraver Heh, I thought so, thanks. Still, I don't understand why it was getting put inside the <tr>.
 
Append is inside of the element, after is outside (a sibling)
 
@tpae Append creates a child element doesn't it? I just wanted a sibling
 
@Nickcraver doesn't child() exist?
 
6:55 PM
Yes..
 
oic
 
@user457827 - no, because an element can have many children, but only one parent, so the collection of child nodes is .children().
 
@users unite!
 
@user257493 Why no name users?
 
arrrrrgh, these @user characters make autocomplete annoying, time to use it against you
hey @user like that notification?
 
6:56 PM
:)
@user doesn't notify me
 
@user get a name!
 
NEVER!
Don't make me change it to @userTwoFiveSevenFourNine
 
seriously? that's quite the 1 way street since you're fubaring my name autocomplete
 
Bye all, have fun @user
 
@Nickcraver ok thank you im getting it now
 
6:57 PM
Thnkas you too!
 
@Nickcraver you could have alot of parents too
 
No user, keep it!
Don't let the brotherhood die!
 
@user457827 - not immediate parents, .children() is immediate children, .parent() is the immediate parent
.parents() for the entire parents chain, .find('*') for all children
 
@NickCraver kudos to you for helping like 8 people at once, I've seen you do it in SO, even more impressive in real-time
 
@nickcraver o okay, like the one next to the $this ?
 
6:59 PM
@sworoc - I'm mulling over how to do this validation on our data context, answering questions helps me think :)
 

« first day (9 days earlier)      last day (4940 days later) »