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

7:00 PM
@nick what's the validation issue you're working on?
 
@user457827 you lost me, what is $this referring to?
 
do you mean $(this)?
 
@nickcraver $(this) yes..
 
@user257493 - validation via IValidatableObject is easy for our custom stuff, but how to tie in doing it on certain property changes is a bit different, seeing how to elegantly unify the two like we had it on Oracle before this SQL server move
@user457827 - $(this) is a jQuery wrapper containing the current call context, usually the element you're dealing with in the event handler
e.g. $(this).remove() would remove the element you clicked on (unless you're in a different context/scope for some reason)
 
@nickcraver yes exactly, and the immediate parents you were talking about above, is the ones next to that element you are working on, right?
 
7:03 PM
yes, correct
 
Me thinking * say yes, else im stupid*
 
forgive me for not autocompleting your name, it does get extremely annoying :)
 
never stupid, just always learning new things!
 
thank you so much nick
 
hi everyone!
 
7:04 PM
any way to rep you somehow
 
no problem :)
@pablo - hi there
 
@PabloFernandez hi
 
hey @NickCraver
just saw you commented on something not being a closure
(thanks for answering my question btw)
 
@user457827 - if you have a specific question that comes up later, post it on SO, if it's tagged JavaScript/jQuery I'll probably stumble across it :)
np
 
do yo have a good reference on javascript closures?
It may be a book or web blog
anything
that's kind of a gray area and everyone defines it differently
 
7:06 PM
I would say it's defined the same, people's understanding is a bit off though, @CMS has some excellent posts on this, let me see if I can find one
 
thanks @nick
hey @sworoc what's up man :)
 
jquery mobile rocks
too bad for lack of blackberry 5 browser support
 
@NickCraver I see you anywhere on SO and here, I even wonder sometimes if you are human. Really nice knowledge of programming you got. Thank you for sharing to me and im sure all others too....
 
@user457827 - lots of very smart people on SO, you just tend to find those most active in the topics you're also in is all :)
 
Is it possible to make browser interpret the data they receive for script as soon as they get it, instead of when the connection is closed ?
 
7:10 PM
@PabloFernandez - the site seems down at the moment, but give jibbering.com/faq/notes/closures a look
 
@NickCraver im sure your're right hehe, when I have enough knowledge I will be apart of answering.. only the time can tell
 
@NickCraver thanks again
 
@Nickcraver You have done any work? Would like to see something of you
 
anytime :)
 
@HoLyVieR what do you mean?
 
7:11 PM
@user457827 - yup, but unfortunately most of my work is done behind the firewall, I'll make a lot more improvements to odata.stackexchange.com as soon as I get my machine re-built in a few days...unexpected OS crash set me back a bit
 
@PabloFernandez check out javascript.crockford.com/private.html towards the end of the page, there's a small simple description
 
@PabloFernandez I'm trying to do Comet streaming with script tag instead of XHR
 
@Nickcraver why did I have a feeling you would link me somewhere within the "Stack" sites... Nice ones!
 
The problem I have atm is that browser interpret the data when it's all received, not as soon as they get it
 
@Nickcraver May i ask how old you are?
 
7:13 PM
@user457827 - I didn't do anything on most of those, I recently began helping SamSaffron out on odata though
25 :)
 
If I load up the script data as a normal page, the data is displayed in delayed.
But when it's used in script tag, it's interpret all at once when it's done loading
 
@NickCraver oh okay, see im 16 and i just got comfortable with PHP last 2 years, after years of just using other´s php sourcecodes. Now I like to get as comfortable too with JS for the eye candy and make it all simpler before I take my student (in 2 years) so I have something to work with later..
 
Tom
Q: Why would anyone define methods outside of the class? The only thing you do is prevent access to private variables, and you don't add any features. Why not just always create methods within the class?
 
i have an iframe that sometimes have a vertical scroll. i'm using scrollHeight to change the height so i can get rid of the vertical scroll but why does it return the same value with or without the vertical scroll
 
Tom
I think I found the answer: "Having too many privileged methods can cause memory problems because new copies of all privileged methods are created for each instance."
 
7:19 PM
@Tom - you mean an object, right?
 
@Tom tons of reasons. You can override an already defined method, add new ones etc based on events/actions etc.
 
Tom
@Tom, I always considered objects as instances of a class
Ehm, I'm getting tired.
Speaking to myself.
 
Anyway @Nickcraver thanks for helping, i'm off for now.
 
@Tom That's what they are...
 
Tom
^ @ Russ
 
7:21 PM
welcome
 
Tom
I agree Espress
 
@HoLyVieR I see. I've never done something like it, sorry I cannot help you :(
@HoLyVieR anyways... I don't think javascript can be interpreted as soon as it arrives
 
@Tom they have constructors that perform a similar function to a class, but they are not classes as such
 
think for example that your code calls doStuff() in the first line
and doStuff() is defined in line 900
 
Tom
I think the biggest problem with privileged methods in Javascript is that inheritance does not break encapsulation
 
7:25 PM
(please someone correct me if it sees that I'm talking nonsense)
 
@Pablo - it sounds like you are talking about hoisting
 
@RussCam indeed. I guess that the way hoisting works in js makes it impossible for browser to execute it as soon as it arrives
like @HoLyVieR wants to do
 
@PabloFernandez I see
 
function foo(){...} // hoisted
var foo = function(){...} // not hoisted
 
also @HoLyVieR I don't think that you would drastically improve performance in doing that
have you read Souder's books?
they are awesome :D
 
7:28 PM
most js files can be parsed initially in ms
 
there are quite a lot of hacks for frontend speed improvement
 
@PabloFernandez Well, im mostly just looking for a way to do Streaming with Javascript that is cross-browser
 
@KenRedler tricky question...
var foo = function foo() {} // hoisted?
:)
 
@PabloFernandez that's funny! I think technically no, because the var will cover up the local reference, so others can not access the hoisted foo.
 
@Pablo, no only the variable foo is hoisted I believe
 
7:32 PM
@PabloFernandez
foo will be hoisted, but as undefined.
 
Hey, a beep!
 
not hoisted
just tried it out on jsbin.com
damn I need to polish my js... working on the backend can ruin your mind
 
What does the parentheses at the end of this statement do? What is it called?
gist: Closure, 2010-10-25 19:35:28Z
var myObject = function () {
    var value = 0;

    return {
        increment: function (inc) {
            value += typeof inc === 'number' ? inc : 1;
        },
        getValue: function () {
            return value;
        }
    };
}();
    
 
it executes the function right away
 
@BryanRoth the anonymous function
 
7:41 PM
Interesting. What is this called exactly?
 
just makes the function run immediately, which looks as though it assigns the object to myObject
 
It is making use of a closure, so that value is not visible to myObject
 
"executing a function" :)
 
Excellent. Thanks for the great answers!
 
7:43 PM
@BryanRoth it's the equivalent to this:
gist: 645580, 2010-10-25 19:41:44Z
var objectCreator = function () {
    var value = 0;

    return {
        increment: function (inc) {
            value += typeof inc === 'number' ? inc : 1;
        },
        getValue: function () {
            return value;
        }
    };
}

var myObject = objectCreator();
    
 
@PabloFernandez So, 'myObject.value' wouldn't be a legal call?
 
@Bryan that's correct sir!
 
right, it is "hidden" and is only a resource available to increment and getValue
 
that's right, it's not addressable from outside
 
wow this chat stuff is actually fun
I should hang around more often
so much better than working :P
 
7:45 PM
ya fairly useful
 
indeed, it is very cool
 
indeed, very well done :)
 
:) I like it since it's more interactive.
 
Yeah, I kinda think there is an overlap though
 
mostly because it is more back and forth and short-turnaround
 
7:45 PM
between this and the QA site
 
true
 
if i need a quick "i don't remember this stupid thing" question, i would post it here
 
also if @BryanRoth had asked that on SO, it would stay there forever for people with the same question
 
or if i have specific follow-up questions, this is way better
 
sometimes your question can get lost, and hence no answers
even though the question can have merit
so this woudl help that
 
7:47 PM
True. Waiting is the hardest part with asking questions on SO.
 
indeed
 
@PabloFernandez In terms of the hoisting question, maybe the function expression portion (left) is hoisted, but the named function portion (right) is not -- thus "not a function" vs undefined...
 
@Ken I probably need to re-read about hoisting
 
Half-hoisted by its own petard
 
for me it was like "no matter where your function is defined you can call it"
Now I see there's quite a lot more than that
 
7:51 PM
If I understand hoisting correctly, var statements are moved to the top of the function scope, followed by local function definitions. It is just re-arranging the order in which things become available in the background
 
The annoying part is when someone else likes to use function expressions as a stylistic choice (so they think), not realizing they've created dependencies.
 
@KenRedler Can you give an example?
 
@KenRedler @BryanRoth +1 we want examples :D
 
+1
 
Sorry if you've already been through this, I've only just jumped in. In variable declarations, only the declaration gets hoisted and not the assignment (var f = function(){}). For function declarations, the entire function will be hoisted (function f() {}). Ref: adequatelygood.com/2010/2/JavaScript-Scoping-and-Hoisting. Example: jsfiddle.net/davidpadbury/5jMwY.
 
7:59 PM
Contrived, but something like this:
 
Neo
nice
 
Thanks
No blocks of code, I guess.
`(function(){
foo();
bar();
baz(); // uh oh
})();

function foo() { ... }
...lots of code...
function bar() { ... }
...hundreds of lines...
// and in Sally's part of the project
baz = function(){ ... }
phumph = function(){ ... }`
 
and the code?
ohh there it is :)
 
Okay, that's ugly.
 
use gist man!
gist FTW
 
8:03 PM
You forgot to include vapor.js for performance
 
lulz
 
The fact that I'm doing this while on a conf. call is to the benefit of neither this forum nor the others on the call.
 
Neo
sorry to interupt, my first time here in the chat.
 
Productivity: enhanced!
 
Neo
I was looking to convert this mootools to jQuery but I have no idea what hash does, var subcats = cats[foo_barcat_id].subcats;

var subcatHash = new Hash(subcats);

$$('tr[id^=all_fields_]').each(function(el) { if(el.id == 'all_fields_'+foo_barcat_id) { el.style.display = ''; } else { el.style.display = 'none'; }});

if(foo_barcat_id == 0 || subcatHash.getValues().length == 0) {

$('foo_barsubcat_id').options.length = 1;

$('foo_barsubcat_id').style.display = 'none';

}
 
8:07 PM
code snippets and chat.stackoverflo.com don't get along well
you might want to use gist instead
 
But it beeps.
 
gist.github.com
there it goes! it picked the link :)
<-- also, my face got bigger
super-mario style
:D
 
You got that power-up
 
hell yeah
 
whoops, lost it
 
8:09 PM
time to kick some ass
 
lol that's a bit ridiculous / funny / awesome
 
hey dude, it's monday
we have the whole week ahead of us
we better have some fun
 
Have any of you heard of or used JScrambler?
 
@BryanRoth
nope
but why would they charge for a javascript minifier?
you can use google's closure compiler for free and it rocks
 
I typically just use google's compiler:
http://closure-compiler.appspot.com/home
 
8:12 PM
 
I was leaning towards Google's Closure Compiler.
 
mmm... don't like it
(JScrambler I mean)
 
Neo
obscurity I believe it's called! I never thought it would be so funny
 
It might lead you to think that you can put whatever you want in your javascript, and then obfuscate it
 
It writes fake new code with "hardly predictable" conditionals.
 
Neo
8:14 PM
@ken it's hilarious
 
I know real people who can do that for free.
 
@KenRedler It's called StackOverflow
 
@BryanRoth It executes the function. If you leave i toff, you just have a variable called myObject
"it off"
 
@lone
@lonesomeday, Good point.
 
Yeah, something about JScrambler doesn't seem right, maybe it's because they charge for "premium" features or their verbiage?
 
So if it works hard to resist static analysis, I suppose they're trying to write new code that is somehow "plausible" to Closure.
 
Neo
man I love this chat
 
The more plausible it is, the more likely it is to interact with the "real" code. Sweet.
 
Neo
@ken, I kinda think that creates a little more challenge and motivates the hacker, and I bet there is something that you can finger print this, then you know there are fake ones and you can just run it
 
8:19 PM
It's impossible that this could be any less efficient
 
@clarkf and they charge you for that crap
 
Neo
yeah plus like clarkf pointed it's not efficient at all
 
Maybe the fake code is its own little river of functionality, running side-by-side with the real code. Code steganography.
 
lol
 
That code loops through (on Chrome), 592 elements, and does string manipulation on every one of their names
in place of navigator.plugins.length
 
8:22 PM
@clarkf LOL
 
Neo
you know they are not entirely stupid they know noobs will buy this stuff, they
're goona make money off of it
 
They just need to run some ads in a few in-flight magazines and they're set.
 
@Neo everyone seems to be making money these days
 
I guess it is sort of a tempting offer to take a platform that necessarily shares your source code with the end-user and make it obtuse
 
check this site textbroker.com
they raised millions of euros from VCs
 
8:25 PM
but really, at the expense of that much efficiency...it ain't worth it!
 
yeah, it's quite ridiculous
 
and if you go here:
in the first example there is a typo
no kidding
I mean I'm an argentinian, my english sucks, and I can tell there's a typo on your "professional content generation" site
 
@PabloFernandez Yeah, but that's because it's only "quality 2 - legible." * sigh *
 
The whole premise is basically a mechanical turk for google spamming.
 
@KenRedler Hahaha
 
8:29 PM
<script>alert('hi');</script>
;)
 
Neo
oh what happened I got an error saying hi
jk :D
come on guys instead of talking about SEO lets talk Javascript lol
 
@mellamokb should have used an obfuscation tool for that.
 
Neo
I saw this jQuery plugin that would create this links for SEO purposes doesn't google bot crawl the web without javascript?
yeah check out jscrambler.com
 
@Neo No, I'm pretty sure not that long ago googlebot learned javascript
Googling, I found: labnol.org/internet/search/… <- No idea how reputable labnol.org is, but at least I didn't make it up!
 
Neo
//code A
if(/*hardly predictable predicate (false)*/) {
//dead code
} else {
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(c/a))+String.fromCharCode(c%a+161)};if(!''.replace(/^/,String)){while(c--){d[e(c)]=k[c]||e(c)}k=[function(e){return d[e]}];e=function(){return'\[\xa1-\xff]+'};c=1};while(c--){if(k[c]){p=p.replace(new RegExp(e(c),'g'),k[c])}}return p}('<¡>¢(\'£\');</¡>',3,3,'script|alert|hi'.split('|'),0,{}))

}
 
8:34 PM
@KenRedler
alert('\110\111');
 
Neo
@clarkf ok coool, but I remember seeing in google own webmaster section something about it not too long ago
 
Yeah
 
Neo
@mellamokb that was the free trial you can buy thhe premium code, and there is support for more money too
 
Plus with the proliferation of JS-driven sites that you navigate without affecting the URL, or only the hashtags, the search paradigm has to change
Well, one or the other
 
Neo
I always thought google but will read js for black-hat seo methods but i wasn't sure if it executes it for other stuff, does it like actually simulate different events?
google bot*
 
8:37 PM
@Neo I think it is very limited, from what I can find.
 
Neo
@clarkf i think they should create a program that it's input are the graphical interface as human see it, and click on things and stuff ... maybe they already have
 
Is there a way to have one static HTML file span multiple URLs? I mean, if you go to mycoolsite.com/, and you click the JOIN MY WEBRING link, and the URL reflects that you are taken to mycoolsite.com/webring, but a new HTML file is not fetched from the server, instead loadPage('/webring'); is fired?
 
@path411 I was thinking something like this: s='a';e='l';c='e';r='r';i='t';t='("hi")';eval(s+e+c+r+i+t);
 
That is the functionality that hashtag navigation is trying to emulate, but is there a way to do it without hashtags?
 
that'll outsmart those pesky competitors
 
8:41 PM
haha
 
Neo
well do want the actual url to change? or just the href be the url?
 
I want the browser to display that I have been taken to /webring
 
@clarkf weren't you in /webring in the 1st place?
 
Er, no.
You start out at an index page, / - the home page
 
let me see if I understand..
 
8:43 PM
You click a link
 
you want to change the browser URL with no page refresh
 
yes
 
Neo
I don't think that's possible, because if I'm not wrong it's a security feature built into browsers to not do that.. even most browsers will take you to the link if you directly put it and the page has a prevent default behaviour for going from the page
 
would something like this work for you ? :
mycoolsite.com#webring
 
Yeah, that seems about right, but as far as SEO goes, it's desirable
@PabloFernandez I'm familar with hashtag based navigation, but Google isn't
 
Neo
8:45 PM
that would be a great way to hack people... the IETF would never let it get there
 
That's true...I hadn't even thought of phishing
 
Neo
but you said without the hash
 
so the fragment is out of the question?
I don't think there is a way without it
 
Neo
but why would you wanna do that, anyway?
 
Because right now, Google can't index mycoolsite.com#webring
it can only index mycoolsite.com and mycoolsite.com/webring
 
8:47 PM
I think the html5 spec allows for editing history and the current url
 
Neo
so what you should do is have yourcoolsite.com/webring exist and show what mycoolsite.com#webring will
 
@path411 Aha! Google reveals: window.history.pushState(“object or string”, “Title”, “/new-url”);
 
Neo
but with javascript change the behavior when user clicks n the link so they go to #webring instead of /webring
 
HTML5 has window.history.replaceState()
 
Wow I got lost here
 
Neo
8:49 PM
the URL bar is not part of the DOM!!!
 
@Neo Then what is the point of having it dynamically within index.html?
and DRY!
I don't want to maintain loadWebring()`and /webring/index.html`!
 
Neo
you don't have to here's what I did today with jQuery jQuery("a[rel*="+a+"]").click(function(e) {
e.preventDefault();
var b =jQuery(this).attr('title');
var c= jQuery(this).attr('data-hovercard');
tabIt(jQuery(this).attr('href')+'&nohead=yes&b='+b+'&c='+c+'&lastOpen='+openTabs.length, b,c);
});
the javascript passes the nohead GET param if it exists it's DRY
you maintain one page
how can I get HTML5 on ubuntu?
 
chrome?
 
@KenRedler Yes, yes, yes!
 
Neo
8:52 PM
now the tabIt function basicaly get it through AJAX
 
@Neo Pretty much all modern browsers support HTML5 at least a little. Try getting the latest stable Firefox, Chrome or Konquorer
 
Neo
now this is a little different but I was trying to make a point of not needing to maintain multiple...
I have latest firefox
murraypicton.com/playground/… says I dont
 
You will need firefox 4 for it.
 
it's working for me on Chrome 8.0.552.0
 
And for me on Chrome 7
 
8:56 PM
btw, if you want to make your ajax app crawlable by google, you can also use their ajax crawler API: code.google.com/web/ajaxcrawling/docs/getting-started.html
 
Neo
ok I have to compile firefox 4 for ubuntu AMD64 I'll do it tonight
 
Up next: <blink> in the address bar.
 
is there a way to get http status of the current page?
 
Neo
yeah most framework libraries have it through AJAX
 
if you want to get the status of the current page, you'll have to use an AJAX request to the current page. see stackoverflow.com/questions/837064/…
 
8:58 PM
@wcpro = alert(200)? :)
 
hmm
what about for an iframe
 
if you go down the AJAX request route, use a HEAD request to limit the response to just the HEAD.
 
Neo
@nick was that a joke?
 
for an iframe, just make an AJAX request to the current location of the iframe.
 
@Neo - nah never!
 

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