« first day (381 days earlier)      last day (4561 days later) » 

4:01 PM
@RyanKinal i realize now that my original question is silly... how do i transfer all of scripts from current page to the new one?
 
...
 
i know..
:-(
 
;-)
 
i realized that i have some anon $(function(){...}) that dont transfer
 
I figured that would be an issue
 
4:02 PM
@RyanKinal any solutions? ^_^
 
<script type="text/javascript" src="scripts/myscript.js"></script>
 
@RyanKinal thanks capt obvious, i mean how do i just dynamically know what scripts i included?
 
user1385191
beware the "dynamic" buzzword
 
user1385191
and its cousin, "general-purpose"
 
....
 
4:07 PM
jsfiddle.net/AndyE/GQk3G <--- @Opera, @Firefox, @IE 9, @IE 10: WHAT THE FUCK!? @WebKit: whose a good boy? you are! yes you are, you're a good widdle boy!
 
/** in the parent **/
var scripts = document.getElementsByTagName('script');

/** in the child **/
var scripts = window.opener.scripts,
    i;

for (i = 0; i < scripts.length; i++)
{
    document.write('<script type="text/javascript" src="' + scripts[i].src + '"></script>';
}
 
@RyanKinal thanksy ^_^
 
No guarantees ;-)
 
user1385191
@AndyE easier to pick out in the console: jsfiddle.net/GQk3G/2
 
@Neal I'm just warning people that code is unstable. Why should I fix it, i'm not going to use it.
 
4:12 PM
@RyanKinal does not run the code inside the $(function(){...})
 
@Neal Huh. I'm out of ideas, then. Do it the old fashioned way, and duplicate your <script> tags.
 
user1385191
this just in: Safari is still slow as molasses
 
@RyanKinal isnt that what your code does?
 
@Neal That's not the OLD FASHIONED WAY
The combination of ctrl-c and ctrl-v is not always the devil
 
@MattMcDonald I wanted to make sure the correct computed styles were being read and set. They are, but the element isn't painted with that in Firefox, IE and Opera.
 
4:15 PM
@AndyE what's supposed to happen :S
@MattMcDonald lies :\
Safari 5.1 has a suprisingly lightning fast DOM for me.
 
@Raynos look at the output in Chrome, then in Firefox. In Chrome, the span looks almost exactly like the input. In Firefox, it doesn't.
 
I see, couldn't you just log the ones that are different :P
 
@Raynos: yeah, I could have, but then it wouldn't have logged anything :-p
Can anyone see why the styles are being successfully set, but don't end up being computed?
 
@RyanKinal its a dynamic page. created on the fly...
 
Instead of document.write, try using document.createElement('script'), setting the src, and appending it.
 
user1385191
4:24 PM
you lose synchronicity when dropping document.write
 
Expert Sexchange hit hard
 
hello everybody
is there any way to get element height with javascript
?
 
offseHeight?
 
but it has to include text
so if i put much text
then the heihgt is bigger
 
Yeah. It works that way
 
4:34 PM
because i want that FB activity box is same size than other page content
 
I didn't get that.
 
<script>
document.write("koko: "+document.getElementById('content').offsetHeight+"");
</script>
didn´t worked =(
 
Hold on
Add as many p tags and br tags you want
It'll increase depending on that
To verify, you can try stylizing the div using CSS and set its height to something
@Olli What's with those quotes there in the end?
 
you need to close doucment.write , dont you?
 
Oh, just for a string
Yeah, but you don't need that ""
 
4:41 PM
why
 
Just document.write("koko: "+document.getElementById('content').offsetHeight); should do
@Olli Why do you need it?
What's it there for?
Note that offsetHeight may be incorrect if CSS gives it a different height and doesn't tell it to overflow
 
ok..
what you exactly mean by that
so is it wrong?
 
or correct
 
And this gives the actual value - 15px
@Olli Depends. If the height is set using CSS and it isn't given any overflow property, it's height will be wrong.
 
4:45 PM
how can i make facebook like box more height
now it´s not height enough
?
 
What are you saying? What 'facebook like box?'
The sidebar?
 
Oh. Facebook LIKE box. The like button box thing
Just use the height attribute
 
hmm i think height="wefwef" works ?
ok
<script>
var kork = document.getElementById('content').offsetHeight;
var like = document.getElementById('FB_TYKKAA').height = kork;
document.write("koko: "+kork+"");
</script>
FB_TYKKAA is id of FB like box
 
Hold on. I'm not familiar with Facebook's APIs, so I'm not sure I can help you
Do you have a sample page?
 
4:49 PM
i think fb like box behavrious like normal element
 
I think you'd have to use data-width in the div
<div class="fb-like-box" data-href="http://www.facebook.com/platform" data-width="292" data-show-faces="true" data-stream="true" data-header="true"></div>
That's the sample code they give me
 
i dont use width
 
Just add a data-height attribute with the height you want
 
i want height
 
user1385191
I was successful this weekend in completely blocking facebook from my home computer
 
user1385191
4:50 PM
it was surprisingly laborious
 
user1385191
they've got a billion (sub)domains
 
and i use XFBML
 
@MattMcDonald How'd you do that?
 
user1385191
hosts file
 
user1385191
set domains to 127.0.0.1/localhost
 
4:51 PM
Hmm, I was thinking that
That's my ad-blocker
 
and because this i cannot set data-height
could you look it
 
@Olli Then just use height. They're using width, so I'm assuming height 'just works'
@MattMcDonald I know what a hosts file is
 
user1385191
no, that's a link to a pre-baked one with tons of baddies blocked
 
<script>
var kork = document.getElementById('content').offsetHeight;
var like = document.getElementById('FB_TYKKAA').height = kork;
document.write("koko: "+kork+"");
</script>
yes but why this doesnt work
 
4:53 PM
@MattMcDonald Ah. Awesome! Thanks
@Olli I don't know. I can't tell because I don't know what the rest of your code looks like and because I've never used Facebook's APIs. Try asking this as a question and tag it with facebook or something
 
that code is AFTER FB code
@Matt - do you know solution ?
 
user1385191
what tag are you trying to edit?
 
i try edit fb _tykkaa
height
of it*
i hate this chat´s "spam proof"
"you can perform this action again...."
it should have some limit like users with 500rep do not need to wait
 
user1385191
you know, you could just use sentences instead of flooding the chat.
 
so stupid
oh sorry
but i like more writing in more lines :P
i have always typed so in messenger
 
user1385191
4:57 PM
what TAG (ie: "DIV") are you trying to edit?
 
i try edit fb:
<fb:like-box
 
user1385191
oh...
 
user1385191
probably an iframe
 
user1385191
or some goopy mess
 
pardon ?
 
user1385191
4:59 PM
what's your doctype? xhtml?
 
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="fi" xml:lang="fi">
 
user1385191
no facebook namespace?
 
user1385191
you're looking for "xmlns"
 
jQuery 1.7 RC2 is now available! Test it today! http://bit.ly/rMi9cL
 
Oh boy. I was just sent a site design (in ASP.NET + CSS(ish)), and told that it needs "finesse". I'm going to cry a little.
 
5:03 PM
@MattMcDonald yes I have included facebook with javascritp
 
user1385191
that's not what I asked
 
I+m using older version o
the
code
<script src="http://connect.facebook.net/fi_FI/all.js#xfbml=1"></script>
 
user1385191
is there anything resembling "xmlns=\"http://www.facebook...\""?
 
no i dont have it
and it works without it
so,
how could i do it
 
Anyone seen this jsapi.info thing?
It's JAWESOME
@RyanKinal ASP.NET is just a back end. You can do any HTML/CSS you want. finesse shouldn't be that hard.
 
5:12 PM
@MattMcDonald Have you figured it out
 
of course if you have any <asp: type filth anywhere, then well I feel sorry for you :(
 
user1385191
you toss me scraps, and then expect a solution
 
@Raynos Oh, the filth. so much filth.
 
Why do you use asp.net inbuild templating system?
asp.net is really nice if you just write html and only html
 
@MattMcDonald actually I cannot understand what you mean
 
5:14 PM
well comparitively really nice.
 
@Raynos Unfortunately, it was not me who wrote this filth. It would have been significantly less filthy had I written it.
I was handed a page, and told "I need comments. Lots of them. It lacks finesse"
 
@MattMcDonald what you want to ask from me
since i´m not fluent english spkr
 
user1385191
why implement the facebook like button if you don't understand what you're doing?
 
user1385191
it's hacky crap
 
yes but it works
and i thnik it some older version
not the what the example page is showing
 
5:19 PM
does anyone know of a good website to keep up with javascript news?
 
user1385191
 
@MattMcDonald you can just ignore people
@stevebot reddit, coder.io
hacker news is good but its a pain to use
 
user1385191
that, and jsweekly
 
@MattMcDonald how do you filter hacker news
@stevebot oh and the jsweekly
 
user1385191
I rarely use it
 
user1385191
5:21 PM
but it's there
 
cool ty guys, I haven't been tracking coder.io or jsweekly
 
user1385191
jsweekly has too much crap about libraries for my taste, but it's not too bad
 
JS chatroom on SO
 
its a bit dated though
 
UGH people need to STOP supporting DART
stop it now!
 
user1385191
5:23 PM
I can't wait to see their final DOM
 
user1385191
their recommendation is utter crap
 
@Loktar whos doing that?
 
Oh I saw it briefly in your reader
Lawl, "a) Is there any chance that if I self-teach Dart, I can get a job in development without a CS degree, once companies begin using the language?"
I feel like an old man saying this and I hope Im right "Dart will never catch on!"
 
I feel like this is a good time to bring this up, with the mention of Dart: The JavaScript as Assembly for the Web analogy - thoughts?
My opinion is that it's a good analogy. "Higher level languages" (frameworks, transpiled languages, etc.) are being built on top of JavaScript, but the way to get good code is still to understand what's going on behind the scenes. Similar issues arose when higher-level languages started being built "on top of" Assembly.
 
@Loktar lawl!
If you want a job without a CS degree then do open source
@RyanKinal doesn't work like that.
The reason higher levels on top of assembly work is because assembly is a tiny subset of the higher level language
the compilers of the higher level language can maximise the features of the tiny subset
Javascript and java are two partially disjoint sets of programming instructions
you cant efficiently cross compile into javascript
And besides, the reason we compile from x to assembly is because assembly is machine/instruction specific.
(This is why we have cross browser solutions as an analogy, but thats different)
The other reason we have compilers from x to assembly is because X is massively more express / high level then assembly
Find me a language thats massively more expressive / high level then javascript
And "frameworks" are simply build to make architectural decisions for you.
Thats all frameworks do.
This means you dont have to do the hard work but it also means that you do it their way or you dont do it at all.
Personally I saw frameworks are the devil (purism), pragmatically I can see value in a framework if what I'm trying to do vaguely fits inside the framework
The value of a framework is how much does it do for me vs how much does it leak (i.e. how much RAGE is involved).
By that criteria you would never use ASP.NET webforms 2.0 because of the epic amount of RAGE involved.
 
5:41 PM
My point is more in the ease of development vs. efficiency of code, and the argument that "you have to know (JavaScript|Aseembly) to use higher-level-item x". And, to be clear, I'm defining "higher level" as "further away from the architecture on which the code is meant to be run" (so CoffeScript has more steps to be runnable code than JavaScript, and is thus "higher-level")
 
user1385191
we both need to get real blog sites up
 
user1385191
:)
 
@MattMcDonald I have a blog. :P
@RyanKinal thats a confusing definition of higher level.
I always think high level means more layers of abstractions rather then more steps to get to result
And again ease of development is defined as "how much does it help vs how much it makes me RAGE"
 
@Raynos But things like CoffeeScript, Dart, and Java (with GWT) do abstract JavaScript constructs
 
for example express (node.js framework) helps a shit ton and barely makes me rage => win
 
5:44 PM
It seems to me that we get ourselves in a rut of "Learn JavaScript so your CoffeeScript doesn't suck" (which is valid), in a similar way I'd imagine there were arguments that you should "Learn Assembly so your C doesn't suck" (which is also valid)
 
@RyanKinal yes they do abstract themself.
@RyanKinal and it's correct.
why is it a "rut" ?
 
user1385191
real blog sites
 
It's very closed-minded
 
@MattMcDonald no u ¬_¬
@RyanKinal how so?
If you dont understand javascript how can you understand coffeescript? :\
 
user1385191
I overhauled my article if you want to take another look
 
5:46 PM
@MattMcDonald linkify me up.
 
user1385191
the CLJ guys had some really good comments that helped me fix it
 
CLJ ?
 
While it may benefit developers to learn Assembly in order to write massively efficient C (or C++, or Python), I don't think it happens very much anymore. People learn the concepts of memory management and control structures in relation to C, rather than in relation to Assembly.
 
user1385191
comp.lang.javascript newsgroup
 
5:48 PM
comp lang javascript.
I should follow it
 
user1385191
aka the best source for JS knowledge on the web
 
user1385191
you need a usenet client like thunderbird
 
ugh.
cant I use a mailing list or some google tool?
 
And I'm wondering if we're simply on the cusp of something similar for JavaScript - people will learn the concepts in relation to jQuery, MooTools, Dart, CoffeeScript, etc. instead of learning the concepts in relation to javaScript.
 
user1385191
you can read it through google groups, but it's riddled with spam
 
user1385191
5:49 PM
I had to add some filters to thunderbird to deter it
 
@RyanKinal you are the devil :(
However the C <-> ASB is not the same as JS <-> CS
 
@Raynos Maybe a little. But the analogy is there, don't you think?
 
assembly is an epic pain in the ass to write with
C is awesome.
javascript is awesome.
CS is slightly less awesome.
 
user1385191
I follow a fair amount of them on twitter as well
 
user1385191
I can make a list if you want
 
5:50 PM
You may be a little biased ;-)
 
The reason we teach constructs in C rather then assembly is because assembly is epicly low level.
Theres no reason to teach constructs in coffeescript and jQuery rather then in js & dom
there are good reasons to do it the other way around
like the debugging compiled js from cs problem
and the learn how the dom works you ************* who abuses jQuery
 
@Raynos You don't think the DOM is verbose and complicated? How about XHR? JSON parsing and stringification?
 
@RyanKinal no. I actually don't. I'll give you the verbose bit though
 
We've spend the last six months figuring out solid ways of achieving maintainable object-oriented designs in JavaScript, and you still use libraries for it.
 
@RyanKinal I also have zero objection to people using abstractions if they understand the layer beneath
Now the question is at what point do you stop looking at the layers
For example I dont look at machine code, I dont look at ASM, I dont look at C++, I dont look at browser implementations, but I do look at JS & DOM
@RyanKinal correction I wrote a library for OO js but that's not the point.
All I have for OO js is a small set of functions that are sugar to kill verbosity
 
user1385191
5:53 PM
I've finally found a legitimate reason to test on IE:Mac:
 
I will eventually do the same for the DOM when I need it.
 
user1385191
it coughs on reflows
 
user1385191
you can visibly see the effect inefficient code causes
 
@MattMcDonald should I follow this
 
@MattMcDonald Wow. That's... actually legitimate
 
user1385191
5:54 PM
not on google groups
 
Raynos, are you telling me you program javascript without understanding the underlying JIT compilation and garbage handling that's going on?
 
user1385191
in my table cell test, the buttons would get "painted"/frozen on the screen upon a reflow
 
trolololo
 
@david yes I do. Again what I was trying to say is that theres a line where you trust the stuff underneath
I draw the line at not reading the ES engines. @RyanKinal may draw the line at javascript.
 
@Raynos That is exactly the question. We probably aren't at a point where we can stop worrying about the details of JavaScript, but I think we're getting there
 
5:56 PM
@RyanKinal ask yourself why you want to stop worrying about the details of javascript
I want to stop worrying about the details of garbage collection and the jit because well...
I dont want to manually manage memory and I dont want to manually unroll loops
 
@Raynos Personally? I don't. I love JavaScript. But there are a lot of people who simply don't want to spend the time to learn it properly (similar, in that respect, to Assembly)
 
user1385191
CSS question time
 
@MattMcDonald Hooray!
 
@RyanKinal its simply a question of leaky abstractions
v8 & spidermonkey barely leak as abstractions
 
@MattMcDonald I mean NOISE :-P
 
5:57 PM
coffeescript leaks a bit. C#script & GWT leaks epicly.
 
user1385191
if browsers A, B, C, and D all display overflow: auto properly, while browser E hides elements with it, how can I make it work on A-E?
 
@MattMcDonald with or without abusing the broken css parser of browser E ?
 
@MattMcDonald In my experience with overflow: auto, it usually has to do with odd interactions with the child elements of whatever the rule is applied to.
 
@MattMcDonald personally i saw if browser E is a version of IE then use conditional IE comments and IEx only style sheets.
 
For instance, in IE (at least 7, probably earlier, maybe later), elements with position: relative aren't taken into account when deciding whether to scroll with overflow: auto
 
user1385191
6:00 PM
ha, got it to work
 
user1385191
hooray!
 
user1385191
the parent element of the pre tags happened to be a div
 
Interesting
 
@MattMcDonald once again your definition of .removeCell clashes with the WHATWG
why you spread lies?
@MattMcDonald HTML5 also disagrees
@MattMcDonald seriously though, your following an out-dated specification. and then telling other people "this is how it works" when clearly this is not how it works
yes working with the DOM2 subset is cool.
 
6:10 PM
anyone play around with EXT JS
 
But dont work with things that the DOM2 says A about and the HTML/HTML5 says B about. follow B, not A.
@Gavin no, why would you?
 
meh, not my choice @Raynos, for a government project...trying to figure out if one of the JSP files generates content in a certain way
 
user1385191
please link to the multipage spec
 
user1385191
the whole one makes browsers constipated
 
basically trying to figure out if ext-all-css.jsp generated css file differs from page to page
 
6:14 PM
lol
why would you have a JSP file which loads JS library , which then in turn generates css ?!?
its completely bonkers
 
I'm trying to remember the browser control that selects text over html nodes....
 
@MattMcDonald multi page
@MattMcDonald while(row.cells[0]) why u no cache row.cells
@MattMcDonald I personally think you should mention the .textContent alternative to your clearChildNodes method, but thats a minor nitpick
My dad hired someone to do a website, he is a "web designer" and uses wordpress
He just asked me to implement an "online ordering" system.
Client-side functionality I can deal with, thats cool.
But how the heck do I integrate with a wordpress server
 
user1385191
sorry, textContent doesn't jive with the "think in nodes, not strings" mindset
 
@MattMcDonald but it's faster , a lot faster.
 
@Raynos And it will stay faster as long as it's the only one in use
 
6:25 PM
@RyanKinal I see the .innerHTML argument.
 
Or, rather, the one in heaviest use
 
user1385191
it's one of those ugly "shim" cases like addEventListener
 
Anyone remember the method that lets me select a block of text?
 
user1385191
programatically?
 
user1385191
 
I posted it months ago and can't for the life of me find it.
 
@tereško it is but stakeholders run the world my friend, no matter how good you are
 
@MattMcDonald Soooo much bloat for what I'm trying to do. But, at least it has all the code I need... rips things apart
 
user1385191
the guy who made it is a high-ranking user here who knows a lot about ranges
 
user1385191
I trust him
 
6:33 PM
I trust it's a good library, but it's far more than I need.
All I need is one case of selecting all the text in a node.
 
user1385191
4
A: jQuery - select all text from a textarea

Tim DownTo stop the user from getting annoyed when the whole text gets selected every time they try to move the caret using their mouse, you should do this using the focus event, not the click event. The following will do the job and works around a problem in Chrome that prevents the simplest version (i....

 
user1385191
20
A: JQuery: Selecting Text in an Element (akin to highlighting with your mouse)

Tim DownHere's a version with no browser sniffing and no reliance on jQuery: function selectElementText(el, win) { win = win || window; var doc = win.document, sel, range; if (win.getSelection && doc.createRange) { sel = win.getSelection(); range = doc.createRange(); ...

 
@MattMcDonald do you have an objection to .textContent ?
 
@Gavin this has nothing to do with stakeholders
 
6:40 PM
@MattMcDonald cell = row.insertCell(row.cells.length - 1); should be cell = row.insertCell()
if you pass no arguments it automatically goes on the end.
@MattMcDonald you forgot row.appendChild(cell) on appendRowContent
But anyway, I told you all of this last time and you didnt bother making any adjustments
 
US Team: The game objects flicker on direction changes! We need generated spritesheets and change all the logics!
Me: Activates cache-control max age on Apache, and sees a guzillion of GET request vanish; together with the flicker...
And I also made their game load 20x faster or something
 
@IvoWetzel tell management that once the project is over the US team needs to be fired
 
@MattMcDonald wunderbar. Danke.
 
keep a running count of all teh stupid / incompetent things the US team does
and make a note next to it with "how much financial damage this would have done if you didnt fix their shit"
 
@Raynos I hereby endorse this event and/or product.
 
6:54 PM
When do you know your backend sucks?
When it takes up 90% of the load time!
 
@IvoWetzel wait what
are you saying only 10% of the load time is network latency/travel?
 
Yes
out of 17 seconds
10 go into a php file
and no, that's no 5 megs
it'S 10 second on the server
but whatever, not my realm
 
user1385191
after seeing jsperf's PHP, I'm doubting the stuff your company is doing is any better
 
user1385191
is it OO at least?
 
yes
 
user1385191
6:58 PM
well, they got something right
 
still...
it's always magic which classes are available in which file
 
y u no node.js
y u no skilled employees
 

« first day (381 days earlier)      last day (4561 days later) »