« first day (127 days earlier)      last day (4824 days later) » 

12:00 AM
o/
-.- rooky mistake forgot to \" escape your quotes :)
 
.. has come to the conclusion that @Raynos was right about gh-pages > JSFiddle
 
@MylesGray It's a pain though. I keep updating the source of the gh-pages branch
Rather then updating the master source then git pull origin master into the gh-pages branchc
 
and you mess up your versioning?
 
Versioning? :P
I dont do versionining until 0.1 is ready :D
The fact that I use gh-pages for debugging means I have lots of trivial commits
git commit "Forgot to have string as a paramater name" etc.
 
yeah that's what most of mine is like
 
12:07 AM
Yeah until you got a v0.1 just ignore it and clean it up later :P
Probably want to write automated tests aswell instead of just click click click yeah it kind of works
 
wahoo dont need gh-pages
just use the /show on the url
 
That works too
Didnt you know that? :P
 
nope :P
weird... I'm not getting any new script elements but no console errors either
and yes the button is linked to the function right :P
 
Tag lookup does nothing
Its because you suck.
You forgot to append the script to the DOM
Something like document.head.appendChild(createScript)
 
ah shit
 
12:13 AM
Stop making me debug your code :(
 
knew it was something like that
 
Look I have things to do!
 
I just realised as you said :P
 
user1385191
I'm bored enough to debug some code
 
BAM ITS WORKS!
:D
do array.length counts start from 0 or 1?
 
12:16 AM
@MattMcDonald debug
failed : assert.throws with an explicit error is eating extra errors
Just fork it, fix it and ask for a pull request. That'd be awesome.
@MylesGray are you serious? Of course its 0 based
 
no no .length
say an array has 1 element in it
 
user1385191
I don't have a github account, nor have I used git before
 
user1385191
length = 1
 
does it report the length as 1 or 0
 
user1385191
that's why when you loop through, you go i<ar.length
 
12:18 AM
@MylesGray what @MattMcDonald said.
 
as I am running an if that says if(i<array.length){...}
that makes sense now
I need to add a -1 to it
 
user1385191
why?
 
if (i < tagArray.length-1) {
            URL += tagArray[i] + "+or+";
        } else {
            URL += tagArray[i];
        }
 
user1385191
ok
 
What you want there is to just array.join("+or+")
["1","2","3"].join("+or+"); // "1+or+2+or+3"
 
12:27 AM
oh cool thanks :)
 
hey ppl
 
Why is typeof /o/ === function
 
@Raynos regex objects are functions, hrm...
 
@YiJiang thats only true in chrome
I expect typeof /o/ !== "function"
/o/("bar") is invalid
 
@Raynos Oh yes, I remembered Ivo making a note about this on the Garden truth table
 
12:34 AM
Ah shit!
Shit shit shit -.-
You canc call them like a function
/bar/("bar") === ["bar"]
Well
I learned something :D
 
@MattMcDonald still up for some debugging?
 
user1385191
you bet
 
add yourself a tag (just one)
then hit Tag Lookup
I get an undefinded error
 
12:50 AM
JSONData is undefined
 
user1385191
your script is in the head tag
 
@Raynos no it isn't:
function tagQuestions(JSONData) {
    var questionTitles = new Array().concat(JSONData.questions.title);
    for(i=0;i<questionTitles.length;i++) {
     document.getElementById('tagValues').innerHTML += questionTitles[i];
    }
}
 
user1385191
one more reason why inline js sucks
 
@MylesGray I mean the paramater passed in is undefined. Your function gets called with on paramaters
 
thats strange as I added the jsonp callback too
 
12:52 AM
Yeah you did
The JSONP is formatted correctly
 
yep it is
weird shit
 
user1385191
yeah I get errors that none of your functions are defined
 
O_o
 
 document.body.appendChild(createScript);
    tagQuestions();
}
Dont call tagQuestions
The script calls it for you -.- Remove that line and it'll work
3 messages moved to bin
 
Oh I never knew that cool :)
 
12:56 AM
@Raynos Hey cool we have a bin now
 
gah same shit >.>
 
user1385191
lose the inline javascript, make them listeners inside the js
 
user1385191
got it to work
 
user1385191
well functions to call anyways
 
(Sorry it's 8 in the morning woken up at 7 with less than 6 hours of sleep and not quite awake yet)
 
12:57 AM
thats the Event Listener thing?
 
@YiJiang I made a room called bin >_>
@MylesGray havn't you removed the js in html yet? :P lazy!
 
user1385191
you can use el.onclick
 
user1385191
or I'll grab john resig's addEvent snippet
 
@Raynos Will be useful, can't believe nobody hasn't gotten round to do that
 
@Raynos no... thought it would be okay but obviously not :P
now i have to find their places in the DOM .... >.>
 
12:59 AM
@MylesGray You really aught to abstract as much away. Complete seperation of your DOM and JS would be great. I mean just bring in backbone.js and MVC :D
 
user1385191
 
and JQ and Mootools and _ and Scriptalicious
:P
 
user1385191
it's just so your listeners are more flexible
 
@MattMcDonald Nice- cool find Ill add that
 
waits for feeds to update again
 
user1385191
1:02 AM
also look at this link
 
http://feeds.feedburner.com/JohnResig
.nodeName Case Sensitivity
http://ejohn.org/blog/nodename-case-sensitivity/
http://feeds.feedburner.com/JohnResig
.closest(Array) in jQuery 1.4
http://ejohn.org/blog/closestarray-in-jquery-14/
http://feeds.feedburner.com/JohnResig
Spring 2010 jQuery Talks

I gave a number of talks this spring on jQuery and especially on some of the recent additions made in jQuery 1.4. Below are all the slides and demos that I've given. The conferences / meetups that I spoke at (or will speak at, in the case of MIX), and the talks that I gave, [...]
http://ejohn.org/blog/spring-2010-jquery-talks/
http://feeds.feedburner.com/JohnResig
Google Cr-48 for Coding

The other day I saw the announcement for the new Chrome OS test laptop and decided to sign up on the off-chance that I might be able to snag one. In the request form I made it very clear that I would be attempting to use this laptop for development (easily my primary activity). Surprisingly [...]
http://ejohn.org/blog/google-cr-48-for-coding/
http://feeds.feedburner.com/JohnResig
Learning from Twitter
http://ejohn.org/blog/learning-from-twitter/
 
This is... sigh... incredibility stupid. Why can't we have a better feedbot?
 
Ah feeds ;_;
@YiJiang what did you do!!
 
@Raynos Added jresig's blog feed
The first link to the feed itself is totally unnecessary, or at least it should contain the name of the feed, not a stupid link
 
1:04 AM
Add dailyjs & cloud9ide. Weekly JS aswell if possible
 
@MattMcDonald how do i specify the element? by DOM relation or ID?
 
user1385191
when you call something and get it through the dom, it's an HTMLElement just like through .getElementById
 
@Raynos Thinking of kangex and others, but hard to do because of the incredibly badly messed up feed post
 
@YiJiang dont know what kangex is
 
user1385191
so feed it the element through the dom
 
1:06 AM
so I can just put in for example: addEvent(date , click, convertDate);
 
@Raynos kangax, sorry. I keep messing up his name. /blames morning and regex
 
Damn I want to be an awesome person :( I need to start up some kind of big OS thing.
 
user1385191
is date an element?
 
it is an elements ID
 
@MattMcDonald It is in HTML5
 
1:08 AM
@YiJiang thats <time>
 
user1385191
no, I'm referring to his parameter entitled "date"
 
@MylesGray if date is a HTMLElement yes.
 
@MylesGray It is. God I think I turned dumb this morning or something...
 
what the hell does this refer to :O
 
user1385191
usually the function in the current scope
 
user1385191
1:10 AM
it's big on scope
 
god everything they teach on my course is wrong
"you dont need semi-colons", "you dont need var", "call functions through onclick and onfocus"
@MattMcDonald what do you mean by HTML Element?
as in <input> or <div> etc?
 
user1385191
document.getElementsByTagName("p")[0] is an HTMLElement
 
user1385191
when you fetch nodes through the DOM, that's what you'll get most times
 
1 message moved to bin
 
user1385191
unless it's a text node
 
user1385191
1:13 AM
or a comment node or something
 
1 message moved to bin
So yes you want to call addEvent with some kind DOM element/node
 
so i put in: addEvent(document.getElementsById('date'), click, convertDate);?
 
user1385191
getElementById
 
user1385191
lose the s
 
user1385191
quick node reference: jsfiddle.net/mkmcdonald/Qk2YJ
 
1:18 AM
@MylesGray that should work :)
I prefer to getElementsByClassName
And hard code in class names rather then Id's. Actually just use MVC >_>
 
@MattMcDonald that cleared it up thanks!
 
user1385191
I just realized getElementsByClassName is actually a valid function now. I always thought of it as a snippet people used
 
@MattMcDonald Only in awesome browsers
 
addEvent(document.getElementById('dateSubmit'), click, convertDate);
 
1:27 AM
@Raynos Only in IE9 and above, so you might as well use querySelectorAll
 
addEvent(document.getElementById('dateSubmit'), "click", convertDate);
Pass in "click" as a string
 
ahh okay
 
user1385191
yep it's gotta be a string
 
Learn to debug code. (Ctrl + Shift + J). Go to the line numbers, read the error. go "Aha!"
 
user1385191
don't forget to think in datatypes either
 
1:33 AM
apparently this isn't allowed: document.getElementById('dateSubmit')
shows as null...
 
@MylesGray theres no dateSubmit ? ;)
 
there is
 
@MylesGray Check case sensitivity?
 
It works. Or should
 
yep all fine
 
1:34 AM
(It's a good idea to use all lowercase in HTML)
 
All Id's are fine...
 
10 messages moved to Sandbox
 
@MylesGray that code runs in the head
 
@Raynos Oh, DOM ready, yes. Not thought of that, hmmm...
Yup, you need write access to be able to relocate there. Might be a good idea to add the other owners
 
The problem is your running the code before the DOM is ready
Append the script to the body instead (the bottom of it)
or write a jquery.ready alternative :D
 
1:40 AM
@Raynos Use window.onload if you're lazy
Though sticking the js to the bottom would be just fine
 
Yeah window.onload = function() { /* add event handlers, play with dom */ }
Would do just fine
 
Not entirely efficient though, if you're loading resources like images, since window.onload would wait for those too
 
@OmeidHerat but fix my code! Fix it good!
 
3 messages moved to The SO Tavern (General)
 
@YiJiang if i could answer my own question i wouldn't ask it
 
1:51 AM
Sorry guys was just off having a shower, I'll fix it now
 
no one is there in that room
 
@OmeidHerat no-one here is going to answer it :)
 
will not always @Raynos :D
 
@OmeidHerat Seriously, though, coming in and asking stuff you know is off-topic is incredibly rude, surely you'd know that?
 
@YiJiang: Negative.
i wouldn't call it rude, but it could be inappropriate.
 
1:57 AM
@OmeidHerat It is rather rude. If you have an issue you can't address find somewhere else to handle it or ask whether its alright to throw an off topic question out there
 
@Raynos, will saying that "I know its the wrong place" is a kind of ask for apologize.
so i wouldn't mind someone ask anything after saying that.
 
@Raynos Fixed... Ish: fiddle.jshell.net/F3keA/22/show
There are no errors in console
but it's not appending to body :/
 
@raynos anyways
what are you trying to do with this script ?
let me give a try and see what can i do for you.
 
JSONData.questions.title is undefined @MylesGray JSONData.questions is an array
var questionTitles = new Array().concat(JSONData.questions.title);
    for(i=0;i<questionTitles.length;i++) {
     document.getElementById('tagValues').innerHTML = questionTitles[i];
    }
To
 
user1385191
tagLookup is not defined
javascript:%20tagLookup();
Line 1
 
2:03 AM
  for(i=0;i<questionTitles.length;i++) {
       document.getElementById('tagValues').innerHTML = JSONData.questions[i].title;
  }
 
where are you guys seeing these errors, my console doesn't show those ones at all
@Raynos ah that makes sense now!
 
@MylesGray Stick the whole thing in a try - catch block?
 
@MylesGray thats not an error. I'm not sure what matt is seeing
 
user1385191
I called the function via inline js
 
@YiJiang try - catch... = bad?
 
2:04 AM
@MylesGray im debugging your code. It works fine with .concat(undefined)
 
user1385191
but your addEvent still doesn't have "click" for the event type
 
@Raynos thats why its not throwing errors..
@MattMcDonald - yes it does?
 
@MylesGray No, you're debugging for goodness sake. try-catch has a performance penalty, but that's hardly relevant here
 
are you looking at the right version
 
@MattMcDonald which browser? I think me & myles are in chrome
 
user1385191
 
user1385191
ff 3.6
 
@MattMcDonald yep that's the most up to date version
have you tried clearing your cache?
not that it should affect it
@Raynos should it not be this:
var questionTitles = new Array().concat(JSONData.questions);
    for(i=0;i<questionTitles.length;i++) {
         document.getElementById('tagValues').innerHTML = JSONData.questions[i].title;
    }
 
user1385191
I'm doing hard refreshes and now it won't even load your .js file
 
Works fine in 3.6 for me (By fine I mean it does nothing
@MylesGray Yes that will work.
Alternatively
 
Your above code wouldn't work though
 
2:08 AM
    var len = JSONData.questions.length;
    for(i=0;i<len;i++) {
         document.getElementById('tagValues').innerHTML = JSONData.questions[i].title;
    }
 
the for loop needs an array to iterate through
there we are
weird.. still nothing
the JSON looks fine
no errors
 
link?
 
user1385191
this is what happens when I depend on firebug
 
user1385191
the code looks a lot better when I paste it into jsfiddle
 
I have added alerts to the code
so it seems the JSON parsing function isn't being called by the JSONP callback
 
user1385191
2:14 AM
in the printArray function, don't loop through the array just to add the array in textual form
 
user1385191
just use ar.toString();
 
@MattMcDonald is there a way of limiting it with commas?
that's why I used the for
 
user1385191
.toString does it all for you
 
oh man thats sweeeet
 
2:17 AM
@MylesGray the jsonp isnt calling the function for me :S
 
user1385191
you might want to put a cap on the script tags being added as well
 
@Raynos me neither, its weird
@MattMcDonald - I'm going to have it delete the last script tag added too
 
user1385191
make sure you check the src before you delete it
 
i can store the last added src in a tempvar and then check against that
 
user1385191
if(el.tagName === "SCRIPT" && el.src.match("http://api.stackoverflow.com/1.1/search?tagged=")){//remove}
 
user1385191
2:22 AM
oh ok
 
@MattMcDonald this is what I came up with:
function tagLookup() {
    var URL = "http://api.stackoverflow.com/1.1/search?tagged=";
    for (i = 0; i < tagArray.length; i++) {
        if (i < tagArray.length-1) {
            URL += tagArray[i] + "+or+";
        } else {
            URL += tagArray[i];
        }
    }
    URL += "&jsonp=tagQuestions";
    var tempURL = URL;
    if(document.getElementById('callback').src = tempURL) {
        var oldScript = document.getElementById('callback');
        document.removeChild(oldScript);
    } else {
Yours has a lot more finesse to it...
I think ill go with it instead
 
Just made another edit to the tag wiki - the new suggested edits feature's really enabled some to add in really useful stuff!
 
Where do I find said tag wiki?
 
@Raynos Click on the tag, in the top box you see a 'about the javascript tag' link
Alternatively, use the shinydropdownthingadongdong on the main site to get there
 
2:33 AM
Holy cow, I'm one of the "top users" in JavaScript!
...Barely!
 
Anything sick or twisted looking about this:
 
maybe you can answer this question then, stackoverflow.com/questions/5044521/…
 
if(document.getElementById('callback').tagName === "script" && document.getElementById('callback').src.match("http://api.stackoverflow.com/1.1/search?tagged="))
    {document.removeChild(document.getElementById('callback'));}
 
user1385191
are you the last one on the list?
 
Yes sir, I am!
 
2:34 AM
@MylesGray Cache the result of the call to document.getElementById('callback')
 
user1385191
then it means you're not on the list
 
@sdleihssirhc that is jsut you in relation - doesnt mean you the top ;)
 
user1385191
it does that for everyone
 
nooooooooooo
blast...
return to anonymity...
 
@YiJiang cache as in push to a var?
 
2:35 AM
@sdleihssirhc Hehehe
 
mumble mumble
 
@MylesGray Yup, why do that super long call three times when once is enough?
 
True that
 
user1385191
@MylesGray .tagName returns all caps
 
@sdleihssirhc I was chuffed with 6th in CSS in the last 30 days
but my answer/point ratio is like 0.7
@MattMcDonald Ill fix that now
 
2:36 AM
@MattMcDonald That too
 
I hate being chuffed.
 
Im the top asker :P
 
i am the most average user
 
@Raynos in JS or CSS?
 
Im actaully supringly in that list
#10 in answers & #1 in questsions (JS)
I forgot I was active :P
 
2:39 AM
who here love internet explorer bugs?
 
Is it me or does she look like the one from lynda.com:
 
@Raynos It's good to know we're dealing with a JS expert.
 
maybe just the glasses :P
 
I aught to get more rep :D
 
user1385191
the js board is nice because there's lots of activity and good questions
 
2:40 AM
shes way too nice.. no downvotes and here for 8 months
@Raynos Ill take some :D
as long as it is a positive integer
 
0
Q: Make chat feed awesome (or at least usable)

Yi JiangIn the Stack Overflow JavaScript room, we wanted to add the feeds of the blogs of several prominent JavaScript developers. This is what we got: This sucks. The format is totally usable, there's no indication of which goes to what (the top link goes to the feed URL, the bottom link links to th...

 
how do i do that yi
 
@sissonb Post a link to the post in question as it's own message; read the faq: chat.stackoverflow.com/faq
 
mmkay thanks yi
0
Q: XML with namespace. Issue with Internet Explorer

sissonbI am having an issue rendering data from XML with namespacing in Internet Explorer 6, 7 and 8(haven't checked 9). It works in Chrome though. The XML is formatted like this, <?xml version="1.0" encoding="UTF-8" ?> <pre:customerAddress xmlns:pre="http://www.example.org/"> <pre:c...

 
@YiJiang the format its totally "unusable"
 
2:44 AM
@MylesGray Uh, yeah, just noticed that
 
0
A: jquery shorttag issue

RaynosShort tags are closed. They are not meant to hold content or child elements. It's a self closing tag. What your trying to do is invalid.

Thats right isnt it?
Short tags are not supposed to hold content
 
@Raynos Besides, jQuery's html method uses the browser's innerHTML
 
@Raynos Yes, but I'm not entirely sure how the browser handles them; that's invalid HTML technically speaking
 
So if the browser can't add the html, there isn't really a way to reprogram jQuery to do it
 
If a tag can contain content, then it can't be self closed I believe
 
2:47 AM
Either way, cc's sol
 
user1385191
that question is really poorly worded
 
how do I check if an element exists in the DOM?
 
user1385191
are you checking an attribute or the element itself?
 
element
 
@MylesGray Give it an id, then document.getElementById for it
 
2:50 AM
var callback = document.getElementById('callback');
    if(callback//exists){
    if(callback.tagName === "SCRIPT" && callback.src.match("http://api.stackoverflow.com/1.1/search?tagged="))
    {document.removeChild(callback);}
    }
 
@MylesGray If it doesn't exist, document.getElementById returns null
 
yeah I'm getting can't read tagname of null
and it crashes
 
if (callback) should be good enough; null is falsy
 
if(typeof nulllllllllllllllll)
 
@sissonb typeof null === 'object'; // true
 
user1385191
2:52 AM
brb, restarting browser
 
craziness
 
@sissonb Meh, what you'd really want would be undefined in most cases
 
@sissonb It hasn't been updated in a while, but fun nonetheless: wtfjs.com
 
yeah, i've actually read about that in "the good parts"
bookmarked though
 
@MattMcDonald hmm removing scripts isn't working: fiddle.jshell.net/F3keA/22/show
I think it is something to do wiht this: callback.src.match("http://api.stackoverflow.com/1.1/search?tagged=")
as it isn't an exact match to that obviously
 
user1385191
2:58 AM
remember .match is for regEx too
 
user1385191
it only looks for that string inside a string then returns true or false
 
hmm.. so it should work :/
 
user1385191
where in the DOM is callback?
 
bottom of the body
 
user1385191
oh right you're trying to add an id to a script tag
 
user1385191
2:59 AM
probably not the best idea
 

« first day (127 days earlier)      last day (4824 days later) »