« first day (299 days earlier)      last day (4649 days later) » 

12:49 AM
0
A: Are login/signup links a semantic use-case of HTML5 <menu>

Thomas ShieldsAs I'm sure you're aware: The menu element represents a list of commands. It really just depends on how you define "list" and "commands." Are "Login" and "Sign up" commands? Or are they list items? Personally I think they're commands. A list (ul or ol) is more akin to something longer, two...

@Raynos ^^ my lame answer. :)
 
1:44 AM
Does anyone know how to force a web browser to render a .js file as a .htm file?
Basically is there a way to set the content-type if the file is locally on your computer?
For example: lets say I open gedit/textedit/vim and create a file called file.js and put <p>test</p> in the file
Now if I open the file in Firefox or any web browser it distinguishes the file as Javascript and therefore displays the file's source code in the browser by sniffing the extension.
An html file on the other hand is parsed and rendered as html.
 
I'm pretty sure no. IE might have some settings on what to do with file extensions tho.
 
that was my guess, do you know what files are aditionally rendered as html besides html and htm?
 
PHP and ASPX might.
 
I'll try it thanks, also do you now how people debugg Javascript that has been insterted dynmically?
 
dynamic JS still usually shows in the Scripts tab of the web inspector, i think.
otherwise shameless jAndy theft I dunno ¯\__(ツ)__/¯
 
1:55 AM
jAndy what does that mean? That makes sense lol
 
see the starred messages on the right.
 
2:07 AM
is there an article describing the correct way to eval content therefore leaving useful linenumbers on errors and other info
 
 
5 hours later…
6:47 AM
@Lime hi
 
Yo
 
@Lime have u ever consume soap with JS?
 
nope, but I believe it is just plain text protocol
 
i dont know i am getting fault code error
 
In what, java?
 
6:53 AM
javascript
1
Q: Multiple SOAP request using Javascript problem

Ajay PatelAll I am using my SOAP API using java script. this example explain how to send single soap request using js var symbol = "MSFT"; var xmlhttp = new XMLHttpRequest(); xmlhttp.open("POST", "http://www.webservicex.net/stockquote.asmx?op=GetQuote",true); xmlhttp.onreadystatechange=function() { if...

 
I'll take a look, not sure how much I can help though.
 
check this question
 
What browser are you getting the error in?
 
i am using SOAP with JS. Here is a code, i dont know what is problem but i am getting error: cannot use object of type stdclass as array I think problem is the random value i am passing.
crome
its work only for crome
i am enyo developer weos3.0
 
It does or doesn't work in chrome?
 
6:56 AM
0
Q: what is wrong this JS ? got this error: cannot use object of type stdclass as array

Ajay Pateli am using SOAP with JS. Here is a code, i dont know what is problem but i am getting error: cannot use object of type stdclass as array I think problem is the random value i am passing. var xmlhttp = new XMLHttpRequest(); xmlhttp.open("POST", "http://service.project...

now check this question
its works find if i am sending only one envelop of soap
but if i am sending multiple soap request i am getting error
like error: cannot use object of type stdclass as array
 
Add how are you sending multiple requests?
Are you just coping and pasting the code or using a closure?
 
no using clouser
see, i think the way i am using in multiple soap req it may b wrong
so i am getting this error
according to you how should i do this
i am doing like this
/*getStanderdReminderSoapInPart*/
var getStanderdReminderSoapInPart = new XMLHttpRequest();
getStanderdReminderSoapInPart.open("POST", "http://service.project-development-site.de/soap.php",true);


getStanderdReminderSoapInPart.setRequestHeader("SOAPAction", "http://service.project-development-site.de/soap.php");
getStanderdReminderSoapInPart.setRequestHeader("Content-Type", "text/xml");
getStanderdReminderSoapInPart.onreadystatechange=function() {
if (getStanderdReminderSoapInPart.readyState == 4) {
simple write soap req again for another envelop with new object
 
Wrap the code in a self executing function, (function(){})() maybe
There very little info to work with, sorry
It isn't even clear where the error is coming console,alert,dispayed on screen ect...
 
error in soap respons
i also tried with function() like call
 
 
1 hour later…
8:15 AM
Hi, i want to delete the contents of a table, which contains "Email Address"
my thread is here but the code answer supplied does not work: stackoverflow.com/questions/7014015/…
 
 
3 hours later…
11:07 AM
RT @nattokirai: Blog post on DirectWrite rendering in Firefox http://t.co/6u4kDtN
RT @joelambert: Want to see the Flux WordPress Plugin in action? Here's a quick screencast/video: http://t.co/gtQ293o #html5 #css3 #word ...
RT @nattokirai: Messing about with subpixel anti-aliasing of text (requires Firefox) http://t.co/2IkLMso
RT @jessibaker: Very useful anatomy of @html5 app, thank you @pinchzoom #technology #developers http://t.co/85dr4sq
 
FEEDS Y U SPAM
 
11:30 AM
wow, this room's a bit empty today
 
11:41 AM
was wondering if jquery's load is a reliable way to check if an image has fully loaded?
like - $("#myImage").load(function() {console.log('fully loaded'});
 
$("#myImage")[0].onload = function() { }
 
12:49 PM
thanks raynos
 
1:14 PM
1
Q: Using Backbone.js with ASP.Net MVC

ArdmanI'm currently looking into the advantages of using Backbone.js, but I'll be using ASP.Net MVC as the main bulk of the site. My question is, is it worth blending the 2 together or am I making a rod for my own back? Should I just use an ASP.Net Web Forms site instead?

 
1:46 PM
function getEventTarget(e){
    e = e || window.event;
}
and attach the function to
<body onclick="getEventTarget();">
I got no error in chrome firebug lite
but got e is undefined error in firebug for firefox
anyone idea ?
 
-.-
because your not passing the event along
dont use "onclick" attribute
use document.body.addEventListener("click", function() { ... }, false);
or use document.body.onclick = function() { }
Seriously your calling getEventTarget() without passing any parameters
And you expect it to work?!
 
arghhh yes
but it does works in chrome
function getEventTarget(e){
  e = e || window.event;
  el = e.srcElement;
  alert(el.nodeName);
}
and <body onclick="getEventTarget();">
i don't know but the nodeName is correctly alerted...
 
....
Again
your calling "getEventTarget()"
WITH NO PARAMETERS
WHAT DO YOU EXPECT e TO BE
 
no no, that's not my correction
 
Use .addEventListener
 
1:54 PM
i just want to tell you
that I use that code, and it works on chrome
 
stop using HTML onclick attributes
 
but not in firefox
 
Yes
 
okay, sure I will do your suggestion, I am just wondering :D
 
Thats because chrome supports window.event
but firefox does not
and so does IE
 
1:56 PM
oh so window.event is storing the last event ?
 
yes
but its non-standard
and we don't use it
We use addEventListener instead
Btw
<body onclick="doThing(event);">
works, but it's not progressive enhancement
it's not seperations of concerns either
"Unobtrusive JavaScript" is a general approach to the use of JavaScript in web pages. Though the term is not formally defined, its basic principles are generally understood to include: * Separation of functionality (the "behavior layer") from a Web page's structure/content and presentation * Best practices to avoid the problems of traditional JavaScript programming (such as browser inconsistencies and lack of scalability) * Progressive enhancement to support user agents that may not support advanced JavaScript functionality A new paradigm JavaScript historically has had a reputation for ...
 
Repeat: inline JS event attributes like onclick, onmouseover, onload, onunload, onfocus, onblur, onsubmit, onkeydown, onkeyup, ondblclick, etc... make baby Jesus cry. And by baby Jesus, I mean Steve Souders and Douglas Crockford
4
In other words, Raynos is correct
 
Ohh, I see, going to delete it right now!
 
Lame example, but it's like having a door with a big ole sign on it that says "WHEN YOU OPEN THIS, YELL!"
instead of having an invisible dinger thingy
 
Of course I have to warn that IE<9 sucks ass
and doesnt support .addEventListener
 
2:01 PM
Sorry Thomas, my current English level, doesn't allow me to understand your sentence XD
 
There's got to be a polyfill shim for that right?
 
0
Q: What does Google or MS get by offering JS files CDN?

SangdolAs you know Google, MS and jQuery.com offers JS files CDN. To do this, they must need to operate significant servers. It'll cost a lot but they offers CDN kind of competitively. Why they do that? What do they get from it?

 
@ayublin sorry. It would be like having a door to a store that instead of having an invisible thing that rings when you enter; it has a sign that says "ONENTER: RING!"
 
flowjs.com is a mediocre dom shim
We have to write this dom shim :\
Alternatively use a DOM library
 
The "Unobtrusive Javascript" comment is the abstract explanation; more practically, the problems with inline event attributes are:
1. you risk overwriting existing event handlers, such as jQuery/Prototype handlers (broken functionality)
2. you can't defer javascript for performance since you have inlined javascript function calls which may need pre-loaded javascript resources - forcing you to load all JS at the top of your document (slower pages)
3. code becomes harder to maintain&bugtrack because code is littered all over your markup, making it harder to refactor (slower coding speed)
 
2:06 PM
@Raynos I am trying to use javascript without any libraries, I use jQuery before, but I don't think I have the basic of javascript to use it without bad practice laying everywhere.
 
@ayublin you must realise the big problem is browser compliance
 
There is no Ishkur...
 
So you have to do this annoying manual shit
 
I found out who my predecessor was. And he's teaching other people. I'm scared, I'm very scared for the future.
 
var addEvent = function(el, ev, cb) {
  if (el.addEventListener) {
    el.addEventListener(ev, cb, false);
  } else if (el.attachEvent) {
    el.attachEvent("on"+ev, cb):
  } else {
    el["on" + ev] = cb;
  }
}
 
2:08 PM
dreamweaver ewww
 
@JensRoland thanks for the explanation
 
However using javascript without libraries is fine for learning, but learning cross-browser compliance is a waste of time
Again you can temporarily use flowjs for some cross browser compliance
and modernizr and any other polyfill
 
@Incognito His misspelt JavaScript...
 
@YiJiang That's not all he's done...
 
@Raynos I choose to use all that shim than learning cross-browser compliance
 
2:11 PM
@Raynos: I second the cross-browser compliance comment; however: if you are going to work as a JS ninja in Silicon Valley, you'll still need to know pure JS - for optimal performance, all the major web sites roll their own core libraries
 
@JensRoland I agree you need to know js and the DOM
I just find it frustrating people are forced to learn cross browser compliance
The DOM is nice
 
@YiJiang Lets just say I have endless material for DailyWTF.
 
Cross browser compliance is endless frustration and a problem solved thousands of times
@Incognito name and shame . Post it!
 
frankly though, f*ck Modernizr - it's cool, but way too bloated. HTML5shiv plus a minimum necessary set of feature detections will take you everywhere you need to go with almost no code at all
 
@Raynos I'll get around to it. DailyWTF doesn't like me for some reason, they never post my subs.
 
2:15 PM
@JensRoland thats what you should use modernizr for
You dont load the entire thing. Thats stupid
I just use a modernizr as an easy collection of polyfills
 
ecommercetemplates.com in the source code of their product, they use about 30 functions, rather than a class, or even a switch/case.
Why? Because the validation digits for credit cards are different. Amex starts with 1, Visa starts with 2, MasterCard starts with 3. Better write the functions ValidateAmexCard(n), validateVisaCard(n) and ValidateMasterCardCard(n).
 
whats wrong with 30 functions?
Oh wait
30 functions for the same thing
 
Yes.
 
BAD CODE Y U EXIST
 
If they have to add/remove a credit card, the code needs to change in six places.
I told my client that they should pay him for just taking the risk of using this thing.
 
2:20 PM
@Raynos: true, Modernizr can be customized, to a point, but I still feel like it ends up being bloated
 
I havnt actually used it
I just assumed you can customize the hell out of it
 
@Raynos may as well dumb it down to the real problem; BAD PPL Y U EXIST
 
@Raynos: It's modular, sort of like jQuery UI is modular
 
Oh -.-
I guess ill just use my own thing instead
 
That's what I do -- I mean, I like the idea of Modernizr, and I am impressed that it actually works so well, but I'm never going to need it unless I try to create a full-fledged online office suite or similar
in which case I'd use Modernizr, jQuery UI, and lots of other bloated-yet-complete libraries
I'd probably even use the YUI Library for that
 
2:29 PM
No dojo for you?
 
I haven't used Dojo in many many years
so I honestly don't know how far they've taken it
it could be pretty cool by now
 
Well Dojo, YUI and EXT are the big guys
there full blown frameworks
I guess Goog fits in there aswell
 
YUI is cool, but I've met some browser inconsistencies with it in the past
and EXT-JS is really cool, but I haven't used it for any proper projects yet
 
I've never looked at google's framework, is it worthwhile?
 
I use jQuery for everything because it makes Javascript feel like pure sex, but I stay away from jQuery UI because, like I said, it's bloated
Google's framework is Java + a compiler which turns it into Javascript
 
2:32 PM
I feel dirty using jQuery now
 
heh
 
and try to do as much in pure js as possible :?
im like really, do I really need to use $('#blah')??
but jQuery is still cool
 
@Loktar You could probably use your own selector engine.
 
no you don't -- getElementByID('blah') rocks and it's FAST (but it is buggy in IE<8)
 
What's the name of that modular JS framework that lets you do that... ?
 
2:35 PM
@Incognito yeah Ive considered that recently just for a learning exp
 
@JensRoland There's always cross-browser concerns: jsperf.com/browser-dom-speed-tests2
 
@Incognito: Selector engine? Like Sizzle?
 
yeah
 
Jquery uses Sizzle.
Sizzle's based around CSS2.1 selectors. You could, in theory, use something that brings compatibility to the DOM API. It's likely to be faster, but requires more knowledge.
 
btw, I tried document.body.addEventListener("click", function(){alert("asdf");}, false);, but it doesn't works..
 
2:38 PM
Sizzle lets you get away with just about anything and still return your result based on very little effort. The trade off, is obviously speed.
 
@ayublin browser?
 
0
Q: Jquery Max character with character count for input and textarea

John MagnoliaI have got this working ok, I just think that it can be improved and reduce the amount of code. If anybody could help that would be brilliant. // Max Length Input $('input[maxlength]').each(function() { var maxCharLength = $(this).attr("maxlength"); if(maxCharLength < 0 |...

 
it works in chrome & FF
 
@Raynos I tried both, in chrome and firefox
 
works for me.
your doing something wrong
 
2:39 PM
body click may not work - have you tried a DIV instead?
 
but only document.addEventListener works
@JensRoland I haven't but it works in document directly
 
ah yes
makes sense
 
@ayublin Woah woah woah, slow down sonny.
Make sure you're clicking in the body
That code works fine if you click in the body, which in a blank document is very small.
 
@Incognito my document isn't blank, and there is this error in firebug document.body is null
 
What is the "this" element you're returning on the event?
 
2:42 PM
LOLOLOLOL
document.body is null
Does your html have a <body> tag? :D
 
"The document cannot survive without the body." - Buddha.
 
@Raynos lol, yeah I have it
@Incognito sorry I don't get your question
 
@ayublin jsfiddle us a sample of the error, pretty please, with sprinkles?
 
@Incognito okay, what is sprinkles btw ?
 
@ayublin Oh sorry, I didn't realize you weren't from a western culture. It's just a meaningless phrase.
You're unlikely to have ever heard it unless you grew up in the culture.
 
2:47 PM
@Incognito haha, it's okay, I am willing to learn :)
 
It's a thing that children say when they really want something. "Pretty please with sprinkles on top," sprinkles are the candy bits that go on icecream. It's actually really meaningless.
 
@Incognito We always said "sugar on top." ;) Just go to show how pointless it is, I suppose
 
@ThomasShields What, you never asked for cherries on top?
 
ohhhhhh, I see now, thanks!
 
@Incognito no. are they good?
 
2:50 PM
@ayublin No problem. Let us know when you have an example of your problem on jsfiddle so we can take a closer look at it.
@ThomasShields Eh, who knows :P. I've never been one for sweets.
Except the band The Sweet.
 
@Incognito lol. I'll have to try it later today.
 
<script>
    document.body.addEventListener("click", function(){alert("asdf");}, false);
</script>
wait, is that okay to put the code like that ?
I got the a feeling that's not right :?
 
@Incognito cool. I'll check it out when I can; gotta listen to a lecture right now.
 
@ayublin Like I said, set it up on jsfiddle. I can't reproduce your problem: jsfiddle.net/EShYR
 
2:53 PM
well actually, i paste the same code in jsfiddle.net, but it works, and still doesn't work in my browser..
 
0
Q: How to port an Apple Dashboard widget to Windows?

user2534I made visual aid type of widget (user needs to see through it) with Dashcode, now I want to port it to Windows XP & 7. I heard that StarDock DesktopX Pro can export standalone widgets as .exe but I don't know if those are native Windows widgets (on OS X they are .widget). Is there a Dashc...

 
@Incognito here jsfiddle.net/EShYR
but it works there, but the exact same code, doesn't show the alert in my browser
 
@ayublin You need to hit save.
Or update.
 
sorry my first time XD
@Incognito jsfiddle.net/EShYR/2, this is strange, it works in jsfiddle, but not in my browser X(
 
@ayublin Eek. Don't set it up like that. JSFiddle tries to separate things.
 
3:05 PM
@Incognito ohh, so no need, html, and head tags? eh, from your modification, so it's really doesn't work ?
 
@ayublin Post your whole HTML file to pastebin. pastebin.com
 
@Incognito here it is pastebin.com/UunYdT3w
 
@ayublin Your script adds the event listener, then the body gets rendered. Basically, you didn't put in an event listener to wait for the document to load.
 
@Incognito thanks Incognito I got it, so just like $(document).ready with jquery..
 
Exactly.
Browsers read top-down and start doing their business.
Your script ran before your body, thus, body didn't exist at that time.
You need to add code that says "wait for the body, then lets do this thing."
 
3:22 PM
Oh I see, thank you!
 
Yeah thats the golden rule with the wife. "Wait for the body, then lets do this thing"
2
dont want to start before.
 
LOLLLLLLLLLLLL
now the rule will not go away from my mind
 
haha
 
@Loktar We need to start a wiki of zen-like sayings about javascript development.
 
lol
ways for people to remember
 
3:29 PM
@Loktar I think it's an excellent idea.
 
Yeah, something that's not so formal
fun and enlighting
 
3:44 PM
hey guys!
 
hey darkyen
 
somebody just asked me
why use JSON !
 
I think because it's thin, no opening and closing tags extra fat..
 
i agree i told him that
hes trying to write a C++ based server
for a javaScript client (he aims to write it himself aswell)
 
4:00 PM
jWorldmaps: The Anatomy of a jQuery Mapping Plugin http://bit.ly/mQe0Rd #maps
 
i told him because that reduces your loss of data possiblity when communicating from C to JavaScript.
by the way @ayublin read the second last paragraph
 
@Darkyen LOL, I didn't realize it before..
 
lol
its hillarious license
i think i am using the JSON license for my next software lol
 
@Darkyen what one?
Theres thingy
node.js and
 
lol, put it big and bold, so that a license finally got a glance..
@Raynos I have use document.body.addEventListener("click", getEventTarget, false); for function getEventTarget(e), but how can I pass the event?
 
4:09 PM
Its passed in automatically
its the first parameter
 
user1385191
ding ding ding
 
user1385191
you also get the this value passed (which would equal the body)
 
ohhh
so if i want to put another parameter for the function, I have to reserved the 2 first parameters for event, and the this ?
 
user1385191
this isn't a param
 
user1385191
it's bound to the function
 
4:14 PM
oh, so only function getEventTarget() is okay, and I can use the event object just by using e inside the function?
oh it's need the e..
 
@MattMcDonald really?
You do,
thats pretty cool
 
user1385191
I touched on the this value in my DOM 0 answer
 
user1385191
IE has problems with attachEvent and the this value
 
@Darkyen I guess the death star APIs are based on XML, not json :(.
Anyone ever just lean back look at their screen and go "How do I know any of this? Am I a wizard?"
 
is e.srcElement not supported in firefox?
e is the event
 
user1385191
4:22 PM
no
 
user1385191
that's an ie prop of the global window.event
 
@Incognito i think there are lots of implementation of json on all the languages
 
@MattMcDonald There doesn't happen to be a table that covers the various idiosyncrasies of browsers, does there?
 
its one of my favorite data transfer method .. as it works on nearly all the languages. and any programmer today ought to think about json as help!
 
@Darkyen Don't get confused with object literals and JSON.
 
user1385191
4:24 PM
you'll find a fair amount on quirksmode, but no
 
^_^ i am not that dumb.
 
@MattMcDonald Is QM still actively updated? Each time I go there it seems old.
@Darkyen Dumb's got nothing to do with it. It's just a common misconception :p.
 
@MattMcDonald ohh, again, different behavior of the browsers..
 
agree
:P but if you spend like 1-2 hours with any of them you wont confuse em again :)
 
@Darkyen Are you sure?
 
4:26 PM
@Raynos . if you are asking then no ^^
 
is there a place where I can see what functions on javascript that will works well on various browser? or maybe a trick for a function so that it can be run in various browser..
 
caniuse.com
quirksblog
mdn
 
jquery ?
 
And then there's browserling
 
user1385191
you're likely referring to the DOM
 
4:32 PM
does internet explorer 8 has localStorage ?
 
check caniuse
and yes
 
intresting.
 
@Raynos thanks, I am bookmarking them now, will open it later, believe it or not my internet connection is going pretty bad at night so that I can't open any web page, only this chat can run..
 
woot! found an awesome cloud ide!
 
4:34 PM
caniuse.com/#feat=websockets .. no fun for a websocket person with IE
 
@Raynos i just thought of a good topic of the week - Cloud IDEs
 
looks good!
@Raynos any place to host node.js projects for free ?? which is NOT my dedicated server i mean for projects made for hobby or a blog etc.
 
@Darkyen cloud9
 
will it host it as a server .. i thought its a cloud based IDE
 
@Darkyen yes, but u can actually run the code
 
4:39 PM
@Darkyen a couple
heroku, nodester, dotcloud
joyent
I've tried all three
Couldnt get my server uploaded and working
 
yeah joyent just takes forever to get a coupon code :?
 
Im just going to buy an amazon EWS
 
okay.
well i have an option
 
EWS might be the best way honestly
esp for mess around projects
Im just hosting mine locally from home right now
 
either buy or use a free service. i choose to be a freebie .. (saving money)
 
4:41 PM
@Neal thats nice an all
but ftp? fffffffffffuuuuuuuuuuuuuuuuuu
 
@Raynos what? codey?
whats rong with ftp?
 
insecure...
but I still use it like a boss.
 
You shouldnt edit code on a live server
tahts stupid
edit it locally
push it using version control
 
eh I just push the prod
my vc is local
ive considered switching it around though
 
wow i got a free username by my real name at joyent .. thats rare to find my username free!
 
4:45 PM
bleh same here since WoW
 
lol
 
I got the .com/net/org before it was popular at least though!
 
:)
 

« first day (299 days earlier)      last day (4649 days later) »