« first day (101 days earlier)      last day (4830 days later) » 
00:00 - 18:0018:00 - 00:00

12:14 AM
What you're trying to do is perfectly reasonable
I'd start with deciding where you want the number, and put in a <span id="thenumber"></span>
then use document.getElementById("thenumber") to grab a reference to that span
then you can replace the contents of the span with .innerHtml
for the crawlers you will want to put the default number in the span... because they won't run the javascript to replace that content
 
Okay good to know. Will the script work, specifically regarding the way it is chained together?
 
12:30 AM
the one you have?
er, is there a reason you haev them in 3 functions? you could just do them all in one
 
yeah, how do we combine them into 1 function?
 
just put all the code into one function?
 
okay. we'll have to try that
 
also, you're using document.write, which is probably not a good way of doing it
 
what would be better?
we're both kinda novices at JS so, we're just trying to figure out the right way to piece this together
 
12:41 AM
opera...
Anyone have an idea why opera ignores the width and height on a block level element?
gosh...
it's not ignoring the size it's just ignoring the mouseover due to the transparent color
 
@david I have to get going but, if you have any further insight, we would really appreciate it if you posted a comment or answer to the question. Thanks again
 
transparent.png, just for you Opera!
 
@IvoWetzel Sad...
 
I know ;_;
But it's working
next step make the content...
then do the two routes: 1. the one without JS, 2. the one with, uses hashchange and gets rid of the full site requests
oh and the slideshow needs to be put in too :)
wonder what's more effective
a 1x1 px background image or a bigger one
that is, not in size but in rendering speed
 
1000 x 1000, BMP encoded
 
12:56 AM
But only in NN4 on Windows 95
 
1x1 "should" be fastest
 
hm, could be, it could simply grab the color and use that
 
You could make a big long one like 1000 x 1 px and use CSS sprites!
 
I suppose...
I'm using them as backgrounds
that is, more or less background color replacement
for stupid browsers without rgba support...
user image
4
 
"the user requests a page, i want to update something in the database
the update is not required for the rest of the request, ideally it should fork off and get done in a subthread, that terminates quietly, possibly after the rest of the request is finished
but that is bloody hard to do simply in the jolly old .NET world
so instead the entire request waits till the database update is completed.
completely tying up one of the asp worker threads in the process... "
 
1:14 AM
@david just buy more Windows servers
 
i shouldn't need to :(
 
@david I betcha you could get a net gain by appending to a text file, and regularly batch processing the text file into the database.
 
Ahaha
i kinda need it to be done immediately
just... not before responding to the request with a 200/Sweetbro
 
there should be a way to flush out the response before execution ends
 
I love my new site...
I wasted a week on a crappy design
then... boom! And I'm nearly done in half a day -.-
 
1:24 AM
@david have you tried Response.Flush() ?
 
er... pretty sure Response.Flush() just sets the encoding to chunked and starts streaming data to the client
 
nice
 
the response doesn't actually end
 
It's official. Never buy anything from BestBuy!
 
why?
 
1:27 AM
Ok, so I had something out for repair. I got a phone call today at 4:30 saying the phone is ready, and that I must pick it up within 5 days for I'll get a $50 storage fee.
As I'm leaving for Europe tomorrow for 6 days, I went out of my way to pick it up tonight
When I got there, the guy said they didn't have it
I asked to speak to the store manager.
He came up and I yelled at him about what's going on. First he threatened to kick me out of the store
And said that I have 30 days, after which they ship it to me for free.
They go in the back again, and they did have it
So they bring it back up.
The resolution?
For a phone with a screen that was acting bad. They 'tweaked the audio settings'
 
lol
 
I flipped out again. They said take it home, and if it doesn't work to bring it back in for a replacement
then I went over to return the loaner and free the $150 hold.
they said that it wasn't a loaner, and that I purchased the phone and refused to give me a refund
I called the store manager over again, and told him I'd void the CC transaction and file a report for fraud if they didn't help.
he over-rode the system and gave me my $150 back.
1:30 in the store for what should have been 5 minutes, and what should have been done after next week when I get home...
/me is pissed
 
@david dumb. This page has a bunch of tips that won't help you either I think.
 
gosh
 
@ircmaxell that's pretty shit o_O
 
1:32 AM
Windows does a horrible job an font smoothing...
and why the hell doesn't IE9 have transtions?
but animations?!?!
 
I guess that's a benefit of putting things on cc, you can threaten them if they try to fuck you over like that
 
@ircmaxell are you really in New Jersey?
 
yes I am
(for the next 22 hours at least)
 
In my quite limited experience, a New Jersey accent is an indication that you're about to get that kind of customer "service"
But obviously you expect better so my sample size must not be adequate.
 
I expect to be treated with some level of honesty and respect. What they did was just plain rude and inconsiderate
 
1:37 AM
Yes
 
(the manager treated me well, it was the underlings that were ridiculous)...
 
 
6 hours later…
Tek
7:31 AM
@JessMcKenzie Good morning?
 
Morning
 
Tek
lol.
I wasn't expecting anyone else to respond
Morning Ivo.
 
Tek
1:31 am here... but I already slept...
my schedule is all sorts of messed up
 
Worked through the night in order to get that website finished
 
Tek
7:32 AM
I know how that's like :D
got it done?
 
90%
missing some JS history changing magic
and... content
 
Tek
Nice. Mine's about 98% done... just tweaking some stuff here and there
lol! I see
Well, not mine but for a client anyway
 
tweaking is the worst part... especially when you can't stop doing it
 
Tek
gah.. I know
 
you just have to ship it at some point...
 
Tek
7:34 AM
Worst feeling after you think you have completed everything... only to find out you're not =(
 
oh yeah... I know that
 
Tek
speaking of sites, quick php question.
if you have a foreach loop and an "if ($condition){break;}
inside of it...
does it break the loop
 
no idea... last time I used PHP was around 2005
Best tip: Make a quick test
 
Tek
Yeah. Was going to do that but I'm kinda tired of working on it so... if you knew the answer that'd feel less of a hassle =P
then again, that's why work is work...
 
well, or you pay me :P
Then I'll happily read through PHP docs all day long
Although I'd be happier to do stuff with Node.js
 
Tek
7:37 AM
hehe
You've been working on that a bunch lately haven't you?
 
Yea, and it's really fun
I'm using express.js for the site with jade as the template engine and less for css
 
Tek
coding, "fun"... if the world only knew =)
 
Ab
@IvoWetzel hi
can u suggest me good unit test library for javascript code
 
7:55 AM
@Ab There are a ton of those
I've used nodeunit, but that's mainly Node.js based (although one can make it work in Browser)
 
8:09 AM
god
how can pushState be that buggy...
 
Hi.
 
8:35 AM
HTML5 history url pushstate thingy API is ....
it sucks
 
HI!
 
8:59 AM
hey guys
o_O is anyone here ?
 
Sure
 
oh hi :D
hey man i wanted to ask you something about javascript
 
Sure
 
I dont really know anything about it ...
Have you used the Maps api of Google ?
 
Not really, no
I have used the static API to embed a static map image into a website before, but that doesn't really count
 
9:02 AM
yeah true
i want to know if dynamic route plotting was possible or not
like showing a race live or something on those lines
 
@Reno Did you see the Google Map racing game?
 
whoa O:
thanks man
 
I'm done for today...
 
9:29 AM
@IvoWetzel Already ?
 
hey....can any of you guys help me?
 
Don't ask to ask. Just ask.
 
ok then...i will
0
Q: Load External Page Into a Div From Table Row Click

WillingLearnerI have an external page that I wish to load into a div. I want this external page to drop down from the top and bounce animate in when it is loaded. This external page has a close button, that upon click, closes the external page contents, and refills the original content that was in the div be...

I hope someone here can help me solve this problem
 
Are you trying to load a page from another domain ?
 
9:47 AM
no
same domain
do you think you can help me solve it?
 
10:22 AM
hellooo
 
10:42 AM
hi
 
11:29 AM
Which is neater and/or more pleasant?
if (a && b) { }
else if (a && c) { }

if (a) {
    if(b) { }
    else if (c) {  }
}
 
Ab
@IvoWetzel hi
@IvoWetzel need some help again
 
11:41 AM
@Ab what's it you need?
@IvoWetzel you've got the reputation of that guy that lives on chat.SO and solves javascript problems.
 
11:55 AM
@Raynos; it depends, how long are the methods?
 
@ircmaxell there not one-liners. 3/4 lines or so.
 
I think I would go with the second example then...
 
is array[i++] = new Object(...) considered bad? i.e. using i++ in one line rather then having i++ on a seperate line.
 
1
A: forcing firefox skip "text nodes" in DOM parsing by javascript

galambalazsYou can check if a node is an element node with node.nodeType === 1. You can also implement the new DOM Travelsal API as functions. var dummy = document.createElement("div"); var firstElementChild = ('firstElementChild' in dummy) ? function (el) { return el.firstElementChild; } ...

Ternary abuse! Ternary abuse!
@Raynos Not really, no, if you know what you're doing
 
lol
commented
 
12:08 PM
always use jQuery from GCDN
 
Oh yeah?
What if I don't want to?
 
<- Was lucky, it was cached so the website did actually work when I showed it off..
 
nice
 
and now... I'll eat some yogurt and watch the snow, falling... storming in front of my window
just when you thought it was finally gone
 
same here
big flakes
 
12:13 PM
It's raining here - the rain starts, stops, starts, stops, starts...
 
I love rain... but snow...
at least rain makes a pleasant sound, snow is just... uh...
 
considering 12 hours to a flight, snow is not good
 
so what now... SO, CR, or more website stuff
 
2
A: forcing firefox skip "text nodes" in DOM parsing by javascript

galambalazsYou can check if a node is an element with node.nodeType === 1. You can also implement the new DOM Travelsal API as functions. var dummy = document.createElement("div"); var firstElementChild = ('firstElementChild' in dummy) ? function (el) { return el.firstElementChild; } : f...

read comments
 
26 hours awake... the perfect time to start watching crazy japanese stuff on YouTube
 
12:18 PM
I've got a 28+ hour day ahead of me, so yay
 
@IvoWetzel ... and wake up with your face to the keyboard and drool on the keys
 
@YiJiang :D
I really fall asleep once in front of my keyboard
oh, btw, anyone have a explanation why IE9 doesn't supports animations but not transitions?
(besides the obvious fact that they just want to showoff with IE9...)
@YiJiang Hm.... next time remove the API key before posting a gist?
 
@IvoWetzel Meh, the API keys for any JavaScript app is already visible anyway
For instance, the elections page I build, or badp's SO Live! The API keys are a bit like an open secret for these apps
 
Ah, ok client side, just saw the changes on my news feed
same with Twitter keys
that reminds me of all the horrible ideas those guys have on the mailing list on how to make OAuth even worse..
 
Anyway, I removed it because the key isn't relevant here
I'm going to refactor that wrapper anyway, the current queuing system isn't very good
 
Ab
12:34 PM
how to get height of div element by id
 
offsetHeight?
Or jQuery... :D
;_;
Dang, sleep deficit really shows itself there
Oh and FX2 sucks
Hard to believe that it was really good back then...
 
@IvoWetzel My god! A proper working box model! I think I want to cry!!!
Compared to IE6 and co., it was a brilliant upgrade
 
12:49 PM
@IvoWetzel youve only been up for 26. you need to go another 6 at least. then sleep for 14 hours and wake up at 7am :)
 
Tek
I fell asleep as well, damn it
 
hi all one question
 
Tek
at least I didn't fall asleep on my keyboard =P
 
I know its not a good idea but due to one use case I am populating a combo box with more 10000 items. its behaving very weired in IE7 in all other browsers its working fine in IE7 its taking too much time
for downloading any idea?
 
1:31 PM
has anyone written a useful wrapper around event.which so I can map them to keyboard keys in a cross-browser safe way. It seems to be a horrible thing to try to do.
 
1:47 PM
Hi guys!
Does anyone know how to target iterations of a specific class in the DOM?
I'm thinking something like className[0], className[1] etc?
 
Thats really vague. what do you mean in context?
Element.className should be a space seperated list of classes.
element.className.split(" ")[i] should work
 
@MylesGray Do you mean something like getElementsByClassName?
 
Okay so I'm parsing some JSON and want it to be insterted into specific iterations of a certain class, i.e. first JSON record goes to className occurance 1, second JSON record goes to occurence 2
@ Yi Jiang - yes exactly that
 
@MylesGray does it need to be raw javascript? Using some kind of CSS selector engine like sizzle would make it trivial
 
@MylesGray document.getElementsByClassName is supported for IE8 and above I think, but otherwise you'll going to need iterate through all elements and examine each of their className
 
1:51 PM
Well it doesnt NEED to be straight JS but I've never used any libraries etc ever
@ Yi Jiang - Compatibility is a big deal for me as this is going to be on my portfolio site, Could such an effect be achieved through a lib like JQuery?
 
@YiJiang didn't know .getElementsByClassName was that widely used
 
@MylesGray Sure, of course
@Raynos Well, most of them support document.querySelectorAll, so...
 
@MylesGray depends whether you want to bring jQuery into it. It is quite heavy. A simple loop over document.getElementsByTagName("*") checking for className would work.
 
wasnt there something to do with IE not liking the name attribute in JS?
 
@MylesGray That was when document.getElementById will also select based on the name attribute
 
1:56 PM
@MylesGray IE has a habit of confusing name with id and returning an object whose name is <id> when using document.getElementById(<id>). Or actaully document.getElementById is actaully document.getElementByIdOrName in IE
 
Ahhh okay sorry for the confusion there
So if im understanding this:
var targetDiv = document.getElementByTagName("slide_content");
Then I can somehow target Tag name iteration 1/2/...
 
@MylesGray Don't quite get you there
 
@ YiJiang, sorry about that;
I'm trying to target JSON data to the specific iterations of the TagName (which I assume is just the same as Class) so does the document.getElementByTagName store them in an array so I can target them like that?
 
var nodes = document.getElementsByTagName('*'),
    targetClass = 'myclass',
    result = [];

for(var i = 0, l = nodes.length; i < l; i++){
    if((nodes[i].className + ' ').indexOf(targetClass + ' ') !== -1){
        result.push(nodes[i]);
    }
}
Do you want something like this?
 
@MylesGray Your getting confused. tagName is things like <div> and <p>
 
2:05 PM
getElementByTagName('div') will get you all div elements in the page
 
What he's doing is getting all the nodes in the document as an array. And then you iterate through them and check for the className and push them to a result set. Then you can manipulate the results as and how youwant
 
@ YiJiang - Perfect!
@ Raynos - Right you are, my mistake im very new to JS
 
@MylesGray be very careful with what you mean by iteration and order. You may find the nodes list doesn't give you all the nodes in the order you expect. In most cases it will work fine but there are edge cases you need to consider.
 
@ Raynos - Thanks I imagined something like that
@Raynos - mine is fairly simplistic of a layout I don't think there will be a problem
 
@MylesGray if you ever need more control an alternative is to recursively walk over Node.childNodes starting with document.body
 
2:12 PM
If it helps understand what I was trying to do I made a question yesterday:
http://stackoverflow.com/questions/4785648/targeting-class-name-iterations-with-js
@Raynos thanks I'l try both methods and see how I get on
 
@MylesGray If I feel like i'll jqueryify what you've done later this evening. Also JavaScript has nothing to do with Java incase you still had that illusion.
 
Oh I believed it was some kind of a derivative of Java, must just be a marketing technique...
Thanks very much Raynos you and Yi have been a massive help
 
was just pwned.. could of swore there was a speed diff between bracket notation and dot notation.
 
2:33 PM
@Loktar why would there be.
@MylesGray bang on. It was completely a marketing technique.
 
 
2 hours later…
4:21 PM
How can i search
all node objects
all text node
with $()???
I tryed $("#text")
but it doesnot work
 
@DanielGR jQuery can't handle textNode - you'll have to iterate over every element's child nodes
 
:( ok thanks
 
4:38 PM
@Shikiryu spamming all the rooms for stars?
 
So much for spamming, putting a funny pic on 2 rooms.
 
:P
I find it quite funny actually, but very true also
 
Plus, as everyone, I don't care about stars. Already got a sentence with 46 in PHP room ;)
 
@Shikiryu just teasing you
what are stars for anyway?
 
Nothing, they won't give badges for that...
Anyway, what are badges for ? :p
 
4:40 PM
I've fallen into the trap of using === on things I expect to be integers but there all strings of said numbers >_<
 
it seems that the starring system only works when people mention starring
[INSERT A JOKE MENTIONING "STAR" HERE]
5
 
@Raynos using XML ? ;)
 
@Shikiryu no
 
there we go
they'll roll in
 
I think stars are either awarded for good statements
or ironic statements about the starring system and how it doesnt work
 
4:43 PM
The funniest starred comment I saw was something like "I use $(chucknorris) { } so the document is always ready"
 
Hi
One question
 
PHP room is so serious. Don't you have any jokes in here ?
 
I have a node n
thats a textNode
how can i add a <label> Hi <label>
into it
What property I have to modify
 
@DanielGR innerHTML ?
 
@DanielGR You cannot add element nodes into textNodes
The opposite works though - using appendChild, you can move textNodes into element nodes, but never the other way around
 
4:47 PM
Hm,
The problem is that
I have to replace this textnode:
"Hi to all thanks so much"
"Hi to all <label color="..">thanks</label> so much"
with:
 
The simplest method would be to modify the innerHTML
Otherwise, it gets trickier
 
Look:
var label = document.createElement("label");

label.innerHtml = this.nodeValue.replace(regExp,reposition);

this.parentNode.insertBefore(label, this);
this.parentNode.removeChild(this);
reposition contains the <><> tags to add
but the problem with that is that the result is:
<label>
<label color="..."> </label>
</label>
(this is a textnode)
 
I guess not.
 
But thats the result!!!
Why not
:(
 
var text = 'Hi to all thanks so much',
    p = document.createElement('p');

p.innerHTML = text.replace(/(thanks)/g, '<label>$1</label>');
document.body.appendChild(p);
Where does your code differs?
 
4:55 PM
But the problem is that
Where add 2 tags
to add the <label>asdas</label>
tag
Thats the only way?
 
@DanielGR I'm not sure what you mean by that
 
I mean, with this text:
"Hi to all"
<p>
Hi to <label>all </label>
</p>
we get
And with that wee add
inecesesary tags in unfinded text
I mean:
"Hi to all" wee search "no"
so: <p> Hi to all </p>
:( see??
 
Tek
I think he wants to highlight text that's being searched for?
 
yeah!!!
 
Tek
:D yay
 
5:02 PM
@Tek If that's the case, read this: james.padolsey.com/javascript/…
 
The only way to add a tag into a textNode
is getting the textNode value
 
Firebug has a habit of getting js files wrong in the debugger. It seems to just crop the file and start over again
 
and create a container that contains a container with the only word that match?
 
Does anyone know why?
 
@DanielGR No, the only way to stick a element node into the middle of a existing textNode is to split up the textNode and insert the element node in the middle of that
@Raynos Did you start Firebug after all the scripts have loaded
Read the article I linked to there, it details the best method to do what you want for a complex scenario. If your situation is simpler (for instance, a single element) you can probably use something less complex, but as a general solution, that article pretty much covers it
 
5:09 PM
Hm
so I can use split and use the word that I'm searching to split the textnode in two parts and then create the 3 parts?
 
@YiJiang does that help? :)
 
@Raynos Does what help?
 
jaja
;)
 
5:27 PM
@YiJiang kind of.
Thanks :)
@DanielGR I would recommend you get the text value of the node. Split it up into 3 new nodes. two text nodes and a label node containing a text node. Then just insert the 3 new elements after the original textnode and just remove the original textnode from the parent
This involves a lot more DOM manipulation and a lot less text manipulation
 
5:47 PM
:= thanks
;)
@Raynos
and all
In what order I must add each text?
Now it works
but replace the nodes in disorder
Look:
 
Tek
@DanielGR You should really sign up over at jsfiddle.net I can't paste code without it now :)
 
00:00 - 18:0018:00 - 00:00

« first day (101 days earlier)      last day (4830 days later) »