« first day (19 days earlier)      last day (4945 days later) » 

1:06 PM
@Tom I dont know why its document. Let me look again
 
Tek
$.post(
"1.php?qid=<?php echo $q_id; ?>&amp;jquery=1", $(this).serialize()

Should &amp; be just that or an actual & symbol?
 
Tom
@Raynos, alright :)
 
@Tom its an issue with the before constuctor thing
 
Tom
@Raynos, yes, I figured, I'm trying to figure out what though
Wow, mochaui.org/demo looks really cool.. better than dojo?
 
0
A: Referencing Javascript variable in OnKeyUp event problem.

EricI think this may be the answer you are looking for. (function(){ var COURSE_ID_List={}, COURSE_ID_List_timerId={}; window.setFilter=function(ddl, value) { var list = COURSE_ID_List[ddl]; if (!list){ list=new ListFilter(ddl); } else if(list.getFi...

^ I'm failing to see a major difference between this answer and my own, except for the unnecessary introduction of a closure
 
1:14 PM
@Tom Function.prototype.afterConstruction, here this contains your ontextchange thing
 
Tom
@Raynos, hmm, what do you mean exactly?
 
@Tom The first thing that came to mind after seeing that is actually ext.js
 
Stepping through this object in the function
"Function.prototype.afterConstruction" contains ontextchange. the this object in the sourcesubmissionConstructor does not
 
Tom
@Raynos so var oldObj = this; points to afterConstruction function, not to the object that it was cast on?
 
0
A: Javascript: resetting object definition with hook added (hooking construction)

Andy EThe problem is this line here: oldObj.apply(oldObj, arguments); In your code, you never actually create an instance of oldObj - you're creating an instance of newObj. Since you're technically replacing the old constructor with a new one, you need to be applying the old constructor function to...

^ @Tom
 
Tom
1:21 PM
@Raynos, @AndyE, that explains -- thanks a lot.. I am coming from a background where this means one thing, so I get confused
Finally I can continue though : )
 
@Tom: happy to help
 
Tom
@AndyE, on a side note, do you know if this is the only way to semi " hook" into a constructor without changing object's creation mechanics?
 
@AndyE why cant he reference to oldObj from above? Isn't that how closures work?
 
Tom
Aka by actually replacing the object
@Raynos, that confuses me too, since oldObj actually points to this
"var oldObj = this;"
 
@Tom pretty much, yeah.
 
1:25 PM
@Tom oldObj is a different this
 
Tom
Is it? Why?
 
@Tom whats confusing you is the this object when prototype.AfterConstructor is called and the this object when the function that prototype.AfterConstruftor returns is called
 
-1
A: How know if there is a style for an id or a class?

JustcallmeDragohttp://jquery.com/ jQuery is great for this kind of stuff.

 
@Tom
    SourceSubmissionForm = SourceSubmissionForm.afterConstruction(function()
          new SourceWindow();
    });
 
jQuery is good for everything!
 
1:28 PM
that calls and sets var oldObj = this; That function call is not using the new keyword so this refers to the document
 
Tom
@Raynos, hmm, so why does oldObj.apply work at all? You cannot apply the document right?
 
@Tom when you call "new SourceSubmissionForm();" your oldObj = this; has already been called
 
@Raynos that function is actually a method on the Function prototype chain. So this points to the function it was called on.
 
@Tom sorry ignore my reference to the document. thats me using jQuery for debugging and getting it wrong
 
Tom
Right, so this points to afterConstruction method? Or to SourceSubmissionForm "method" ?
 
1:31 PM
@AndyE what andy says it refers to the sourcesubmissionform function
 
SourceSubmissionForm
 
@Tom jsfiddle.net/P7cSP/9 use firebug and step through the code using the "debugger;" keyword. If you just step through it and watch the locals window you can see what is happening
@Tom this is what you get for writing complex code :P
 
Tom
Ah right, that's good.. ok @Raynos
@Raynos, its just this library that is complex -- once it works I can create 100% loose objects and glue them together with hooking
which is very easily maintainable in theory
 
Simply put, when you call a method that is a member of an object using dot notation, this becomes the object. e.g. myObj.myMethod(); <-- this === myObj
 
@Tom what kind of project are you working on?
 
Tom
1:34 PM
@Raynos, for now just testing things, practice projects, later on I want to create a big projects in node.js
@AndyE its all beginning to make more sense now : )
 
@Tom im thinking of doing the same. Ill keep an eye on your problems and learn from them
 
// Expanded example:
var myObj = { test: "Hello", myMethod: function () { return this.test; }};
alert(myObj.myMethod());
 
Tom
@Raynos, I know a lot of people create projects for node.js in different ways, so you might want to look at existing ones, though personally I get hopelessly confused when I see files with dozens of objects and hundreds of lines
 
@AndyE ugh whats the this refer to? the function ? myObj ?
 
Tom
Also in node.js you need to make use of namespaces more, I didn't do that much yet
 
1:38 PM
@Raynos: myObj, because the method is connected to that by the dot :-) (same applies for subscript notation)
 
Before I make a multiplayer testbed what happens if I try to put game logic on a server and sends ajax request back and forth at 30 times a second in javascript?
@AndyE also it makes more sense if you think in terms that the object literal uses the new Object word so thats where this points to
 
@Raynos fairies lose their wings at a rate of 30 per second.
@Raynos you can look at it that way, too
 
@Raynos Use comet or some other similar polling technology if you're going to need make that many requests
 
Tom
@Raynos you need to establish an open connection
Nowadays one doesn't need polling anymore right? You can just create a websocket
@YiJiang
 
@AndyE explain the joke,
 
1:43 PM
@Tom Depending on which browser you're targeting
 
@YiJiang I cant support slow browsers so chrome only :)
 
Tom
@Raynos look into a library that first tries websockets, then long polling, etc
 
Tek
@Raynos +1
 
Whats with Chrome's quick ever changing version numbers?
Will they slow now they "caught" up with IE?
 
Tek
They're just numbers, don't look into them that much.
 
1:46 PM
@MikeFielden New release to the dev channel every 6 weeks
 
@Raynos I was indicating that 30 ajax requests per second isn't anywhere near an acceptable rate in JS
 
Seems like 8.x.x.x.x just came out a few weeks ago
@YiJiang I know thats what im talking about, but feels like they release a "major" release every 6 wks
 
Tek
yup
Running Chrome 9 beta atm
 
Me as well
 
Tek
=D
 
1:47 PM
@MikeFielden Look, the version number doesn't really men anything as well
You might as well refer to them by when each of the major features were introduced
 
22 hours ago, by Nick Craver
8's beta, 9's dev
 
Yeah I know... version numbers are useless as a determination of what was done
 
Tek
@AndyE Close enough!
 
Strangely enough, we had a similar conversation less than 24 hours ago :-P
 
@AndyE So i guess 7 is what most normal ppl have then?
 
1:51 PM
@Mike: I'm running 7, because I haven't had time to update to 8 yet
 
Tek
yes
 
@AndyE I guess 30 is a bit low. If you want a responsive client you need probably 100fps
 
8 is beta, so it's mostly for devs
 
.... losers.... teehee teehee :)
 
Tek
lol.
 
1:52 PM
@Raynos: have you looked into some sort of WebSockets API/Long polling AJAX solution?
 
What are you... 3 versions behind? Pick up the adoption rate!
 
@AndyE I was going to write one from scratch
 
Tek
here we go :O
 
@Raynos: cool :)
 
@AndyE I was thinking about using RenderEngine. But I wanted to write something from scratch I think the its best to hand write/optimize the server/client communication rather then the client rendering engine
 
Tom
1:55 PM
@Raynos, they already exist though, eg. code.google.com/p/jquery-graceful-websocket
 
@Tom SPOIL MY FUN >:(
 
Tek
lol!
 
Tom
@Raynos, you can develop me a great library for huge javascript projects while you're at it, and create some great IDE that forces strict typing and more
lots of fun
 
@Tom ** strict typing
@Tom I'll work on implementing lazy evaluation. It's a right pain in the ass that I dont have it
 
Tom
@Raynos if you have strict typing and a compiler, you'll rarely have to debug your app
only if there is a flaw in your actual app logic
 
2:04 PM
@Tom if your writing in C and have a compiler, you rarely have to debug your app
@Tom I mean really? really now?
 
Tom
@Raynos apple != banana
 
@Tom What makes you think strict typing and compiling removes debugging?
 
Tom
@Raynos, I didn't say that
 
@Tom Apart from occasional logical flaws
 
Tom
@Raynos notice "rarely"
 
2:10 PM
@Tom I rarely have logical bugs
 
Tom
That's my experience anyway, when I had strict typing and a compiler I rarely had to debug like I have to in Javascript now
@Raynos same
 
I have to debug assumptions I make about how the browser interprets my javascript
 
Tom
@Raynos, eg. in my example, if I had set that I expect the type SomeObj, but it points to a method, the compiler would have told me
This is already possible with Google Closure compiler and JSDoc, but is a lot of hassle and only convention based - based on comments
 
@Tom but loose typing is beautiful :)
 
Tom
@Raynos, why's that? It causes unnecessary logical constructions to check for types, and overhead because of type casting in the background (I believe)
 
2:16 PM
@Tom I think its just nice
 
Tom
Oh, that explains :p but I guess its a matter of personal preference
 
@Tom I had a large nested object I was using an associative array and when I send it to a webmethod I had to create a typed class with sub classes just to handle it and C# made a mess of it :(
 
Tom
@Raynos, thats why you have classes in OOP, you create an associative array like so: assArr[MyObjType] = new Array();
Then class MyObjType {
someMember:String;
someOtherMem:Int;
}
This way it's very structured and on the server side you know exactly what to expect
 
@Tom sanitize user input.
 
Tom
@Raynos you have to do that regardless
 
2:23 PM
@Tom I guess its useful on multi man projects
 
Tom
@Raynos that too
anyway nice talking to you folks again, have to do some work -- see you
 
Bye tom
when are where do you use
<script type="text/ecmascript">
 
svg?
Has anyone read JavaScript Patterns by Stoyan Stefanov? Amazing book!
 
Yeah that's the one. Design patterns, coding patterns, Antipatterns....really good read. Lots of interesting stuff
 
It's probably really good IF YOU NEED PATTERNS. Some of us prefer to get a cookbook instead. Is it a good cookbook?
 
3:04 PM
@drachenstern - it has some decent souffle recipes, yes
 
@drachenstern no it's not a cookbook.
 
@drachenstern We really need some great cookies recipes, don't we all :P (collective groan)
 
collective groan indeed
@NickCraver I could use a good souffle :D
 
souffle's are easy
 
so you're gonna cook me one?
NICE!
 
3:07 PM
Hey, pre-emptive off-topic alert! :P
 
Stop this.
Its getting silly
handler is undefined
[Break on this error] if ( handler.handler ) {
 
so seriously, I could use a good javascript cookbook, if anyone has any suggestions
 
^ That's a common jQuery error. What does it point to?
 
I constantly need to explain stuff to coworkers :(
 
handler is the object property on event handlers, the actual function on the events object for that type
e.g. $.cache[key].events.click[0].handler
 
3:09 PM
I see
 
@YiJiang Now, I'm hungry.
 
Ugh simple errors are irritating
what are programming "cookbooks" ?
 
> since the advent of Navigator 2.0.
O_o I'm not sure if that's a good thing or a bad thing
 
old books are old
 
3:16 PM
Yeah, but 1997? Are there newer editions?
 
older book
 
To be perfectly honest javascript has changed so much from what it was 6 years ago. you need a pretty modern book 2007+
 
I was showing the "what's a cookbook"
That's why I asked if anybody had any good cookbooks that they liked
 
Pol
Hi everybody!
 
hola@Pol
 
3:17 PM
@Pol 'ello
 
I dont use cookbooks. I look at open source javascript code for patterns
 
Pol
I d like to see some suggestions how can I bind some action to click in empty place!
 
o.O
 
@pol define empty place
 
Pol
Everywhere in browser.. I want to close pop up windows
 
3:20 PM
$('body').click(function(){ ...}); $('body').children().unbind('click');
good lord I don't even know how to specify the parts of the dom that don't have elements
maybe check the clicked location to see if it intersected with a visible element?
 
Pol
@drac ohhh... Thanks
 
you'ld still have to check window.onclick and then have an abort inside
but I think there's a dom checking routine to see if you clicked on an element, or to see if an element exists at a location given by a mouse xy
 
Pol
@drac I'm so lazy .. I could predict that..
 
you're lazy? I'm guessing :p ... I think that's the correct code for writing this func
I'm pretty sure it's at least clean pseudocode
 
Pol
@drac you right... ok ... thanks... I gonna try
 
3:39 PM
Anyway to run a block of code before the code attached to $(document).ready ?
I guess I could inline it.
 
cross-domain restrictions are kicking me in the butt ):
 
Ideally I want to hook a function into document.ready that fires before all the other handlers attached to it
 
@Raynos that sounds like a good SO question ...
 
@drachenstern Thought as much. Might be a trivial solution though
 
3:41 PM
probably a page init
instead of page load
 
I don't need cross-domain ajax.
I just want to access a variable in an iframe (:
 
@rchern What else, then? Framing? @font-face?
 
@rchern what ARE you working on then?
hmmm
 
@rchern Good 'ol framing it is, then
 
I need to know when the iframe's session has been timed out and the user is sitting on their login page. which isn't valid for the user because we have an sso set up. so they said "oh, we'll set a variable you can read so you can re-initiate the sso"
which would work. except for not being able to access the variable (;
 
3:46 PM
@rchern Well, you can try initiating a cross-domain post with that script I have above
 
@rchern: can you get them to modify the hash of your parent page?
@rchern: they could also use window.postMessage() in browsers that support it.
 
can an iframe bubble an event?
if so let the iframe bubble and let the parent page catch it
would that not work?
 
@drachenstern: no, events programmatically triggered within the iframe wouldn't bubble up to the parent.
 
@AndyE hmmm ... as you can guess, I don't work with iframes ...
seems like you could get the parent window tho, from within an iframe, cos it's just a dom element
like I said, I don't do iframes
 
@drachenstern: you can access the parent window, but the problem is that most members are inaccessible because of x-domain restrictions. Attempts to access a variable or an element will result in an access denied error.
 
3:54 PM
cant you dump data in hidden fields?
and access the parents dom tree?
 
@Raynos: no
 
@AndyE which I presume is what @rchern is having issues with
 
@drachenstern: the variables part, yes.
 
@AndyE investigating, never had to deal with iframes much before.
 
and the window event handlers are treated the same as dom elements in this regard?
 
3:55 PM
@AndyE IE7/IE8
 
meaning, could you not register an event handler in the parent and then listen for the iframe to hit the event?
I feel like you already answered it but asking again to ensure I'm clear
 
if it works that'd be fine, better than setting a variable, but I suspect it wouldn't work.
 
@rchern IE8 supports window.postMessage and window.onmessage. The pre postMessage workaround involves running a timer in the parent that checks the value of window.location.hash. The child window can change the parent's location to something arbitrary like top.location.hash = "#reset";
 
oh I admit I have no clue on this, I'm strictly guessing
 
the only downside is that it resets scroll position
 
4:00 PM
): mostly IE7 with some IE8, not the other way around
hash might work though. pretty sure they don't have scrolling on their login page
 
Are you (and they) using jQuery? benalman.com/projects/jquery-postmessage-plugin
 
I am. They are not.
 
Tek
4:13 PM
Is there an alternative to CKEditor?
 
@rchern: if you're only bothered about IE 7 and IE 8, there's another solution - shouldersofgiants.co.uk/Blog/post/2009/08/17/…
 
dyndns doesn't like that site...
Hostname shouldersofgiants.co.uk is blocked in your defense plan.
This is a known "Spyware" web site which is blocked as specified by your Defense Plan.
side note: Thought I removed dyndns settings...
 
Weird. I only just stumbled across the site, that blog post seems legit, at least.
 
looks like a legit blog
 
looks legit to me
 
4:20 PM
@rchern if you want to see the article and need a screendump say the word ... (presumably you're removing dyndns tho)
 
yesterday, by Andy E
Man, it really irks me when people shorten "something" to "sth".
^ found something else that irks me almost as much - people using ellipses after almost every sentence and/or people using 4 dots instead of 3
 
@AndyE example
 
@AndyE So 4 dots bugs you but not 3....
:)
 
Yeah...I have a bad habit...of using ellipses...but I do just use 3...
 
4:26 PM
:-) At least it's not as bad as when you see comments like "thanks............"
 
yeah thats much worse
 
(and no, I don't need a screengrab, but thanks)
 
true
 
Tek
@AndyE I don't get the logic behind so many ellipsis. What is that supposed to mean?
 
@rchern yw
@Tek that you're not committing to what you're saying...
 
4:28 PM
Just got an email containing something that bugs me... When people end an email with "Thanks!" when excitement clearly isnt necessary
 
@Tek One possibility: non-native speakers confusing the ellipsis with the full stop.
 
Ellipsis (plural ellipses; from the , élleipsis, "omission") is a mark or series of marks that usually indicate an intentional omission of a word in the original text. An ellipsis can also be used to indicate a pause in speech, an unfinished thought, or, at the end of a sentence, a trailing off into silence (aposiopesis) (apostrophe and ellipsis mixed). When placed at the end of a sentence, the ellipsis can also inspire a feeling of melancholy longing. The ellipsis calls for a slight pause in speech. The most common form of an ellipsis is a row of three periods or full stops (...) or pre...
 
Tek
@YiJiang Full stop of? The sentence?
 
> When placed at the end of a sentence, the ellipsis can also inspire a feeling of melancholy longing.
 
@Tek Yes. @AndyE Hehe... not the intended use here most of the time, that's for sure
 
4:30 PM
@AndyE that's what I always think of ... kind of like the morose phd student on Bones
 
lol (edit, I mean, 'lol...')
 
OT: speaking of, when he came back this season he was quite pep, now he's gone downhill again hmm? He's probably my favorite tho.
 
@drachenstern: I don't think OT: was necessary there, it's a long scroll up to get to the on topic stuff :-P
 
lol
just pointing out I'm going to branch ;)
 
Tek
4:46 PM
How can I check if a textarea is empty? I have an idea but I'm probably wrong :x Pleas correct me if I'm wrong:

$("#jqueryform").submit(

function(e){

if ( !$( '.textarea' ).val( '' ) ) { $.post(//somecode) }

else{ //Alert user to fill before submitting. }

}
 
@Tek No, that's will set the textarea's content to nothing, if it'll work at all (.text() not .val()? Or does jQuery do the correction?)
 
@Tek: don't pass an empty string to val() if you want to check that its value is empty
@YiJiang both should work
 
@AndyE Yeah, I just remembered, it does work
@Tek I think if($('.textarea').val()) should be enough
 
@tek if ($(".textarea").val() === "")
 
It's 2010 and people still want to do this ><:
0
Q: jQuery scrolling marquee in html page title tag

sadmicrowaveI want to place a scrolling marquee in my html title tag using jquery but don't know how and can't seem to find a good explanation online anywhere. Can someone help me please?

 
Tek
4:52 PM
@YiJiang If you only knew.
 
lol, wow
 
>>> !!'false'
true
>>> !!'0'
true
>>> !!''
false
 
$(".content").wrap("<marquee/>")
 
if($('.textarea').val()) is enough - any string of non-zero length should be truthy
@Raynos He's not looking for marquee - it's the title text moving from left to right effect. Completely different
Just a friendly heads up before somebody downvotes you
 
but that is a marquee ...
 
4:57 PM
@YiJiang I noted that myself.
 
it's just that the tag is obsolete
 
@YiJiang I tested it and it doesnt work in <title> so I deleted the thing
 
oh nm, the title
my bad
why on $DEITY's green earth would anyone have a good need for scrolling the title? this has to be for pleasure, not business
 
Tek
@YiJiang if ( !$( '.textarea' ).val() ) Is this how I would check if a string is not empty?
 
the last time I cared for that was Winamp when I had to deal with a taskbar icon
 
4:59 PM
@Tek
 
@Tek or check the length of that for == 0
 
@Tek I believe Javascript's quirky type coersion rules should make it work.
 
yay for relying on a quirk
 
var isEmpty = ($(".textarea").val() === "");
if (!isEmpty) { /* stuff */ }
 
@drachenstern It's not really a quirk - the type coersion rules are laid out somewhere, I just never bothered looking
 
5:00 PM
@Tek yes type coersion will make it work because "" converts to false so the === "" is for readability only
 
Tek
@Raynos You really insist on comparing it to a "" string, eh?
 
@YiJiang I know ... "quirk" != "quirky" :p
 
@Tek only for readabilities sake
 
@Raynos never a better reason!
 
Tek
o=
 
5:01 PM
computers are much better at reading than we are, but they can't fix themselves
better to write the code for our benefit, and let the computer just take an extra couple microops to complete the action
 
Besides this way you clarify that the value should be "" and theres no ambiquity as to what the code should do in case of the string "false" or other annoying edge cases.
 
Tek
awww phoey
I just noticed that won't work
 
for that same reason I would recommend .text() over .val() in case someone stores something silly like false in the value attribute of textarea
 
Tek
I'm using CKEditor and it adds markup whenever the textarea is selected
 
Is it really that wrong of me to want to hook in a $.beforeReady function ?
0
Q: Running a function just before $(document).ready() triggers

RaynosI've attached multiple functions in multiple files to $(document).ready and would like to attach a single function to happen before them as either the first that $(document).ready handles or to independently trigger before the $(document).ready handler. Is there any way to handle the order of fu...

 
5:05 PM
@Raynos so I was looking at that
you have a window.init in some browsers, I think
 
@drachenstern my question is basically is a $.beforeReady custom function bad practice and should I redesign it to trigger ordering with custom event flow?
 
I think that a window.onInit function is a good idea, but I can't imagine how often you would need it
I think that if you have something that needs to occur before the dom is ready, then yes, but I think you have a hard time making that case in most browser instances
because otherwise you should just use inline scripts ...
 
yes using an inline script at the end of the body would be an option
 
but logic encapsulation would suggest that doing it in a member function makes more sense than just tossing a bit of code inline. keeps things architecturally neater
 
but for some reason I rather not
 
5:10 PM
I'm looking at jquery-1.4.2.js line 406 and there's not a hook that you can grab before ready
 
Is it considered bad practice to mess with jQuery's internal stack? (using $(obj).pushStack )
 
Do you have a legitimate reason for doing so? Then do it
 
I presume its for older versions of jQuery where the selector was simpler
 
5:26 PM
hello everybody
any body here??
 
@Alaa yes.
@Alaa Need any help?
 
yes
i want to put exact value to html input field using java script
 
document.getElementById("inputId").value = exactValue; ?
 
i am making like this
var name=document.userAdditionFrom.userName;
name.value="";
but it isnot working
 
do you have a <input type="x" id="y"> on the page?
 
5:30 PM
yes
 
whats the type and id?
 
<input align="right" type="text" name="userName" >
i am using name to pass it as parameter
 
<input align="right" type="text" id="userName">
document.getElementById("userName").value = "valueEntry";
 
Tek
@Raynos I think he still needs name="" to pass the variable
 
document.getElementsByName("userName")[0].value = "valueEntry";
 
5:33 PM
why [0]
?
 
name attributes need not be unique, so that returns a node list, not a single element, you want the first one
 
it's not working :(
 
Where should you use name over id
jsfiddle is lovely. I dont use it enough
 
wow , this website is amaaaaaaaizing , thank u
 
Tek
@Alaa You can say that again. About both jsfiddle and Stack Overflow. :D
 
5:43 PM
yes , of course.
 
Im going home guys
See you
 
see u
thanx again
 
Tek
later @Raynos
 
is it possible to alert to user before asp.net session time out?
i think i have to use client side timer and javascript
any idea?
 
Tek
@shaahin You could just have an alert with a delay.
@shaahin At the same time, serverside you would have a similar time
But you would have the alert come up before the session expires, of course
 
5:54 PM
@Tek tnx
for example
after session time out user starting to enter data
and when he clicks save button he lost data
and he is redirecting to login page
how can i handle this problem
 
Tek
@shaahin I have an idea but I'm pretty new to javascript so I couldn't tell you the commands. You should make a question about it if no one else here answers.
 
ok
tnx
 

« first day (19 days earlier)      last day (4945 days later) »