« first day (596 days earlier)      last day (4355 days later) » 

1:03 PM
define not work
 
sec
 
you have already checked the javascript console for errors as well right?
 
I guess you didn't: Uncaught ReferenceError: addTrack is not defined
 
@Esailija must say dude
your media player
 
its more stable then banshee :-| on my system
 
:-I
what is banshee
 
banshee crashes unexpectedly
like plays song hangs and dies .. x_x
 
wait, what's the difference? esailija
nowrap?
 
just a jsfiddle quirk, you need to run code in nowrap
otherwise it wraps them with a function and they of course won't be globals anymore
 
1:18 PM
how to do that on my website? i'm sorry for newbidity, I code in javascript for only 1 week, and this is my first language :/
 
you don't need to do that in your website
in your website you just have
<script type="text/javascript">
function addTrack() {
    var tracksBody = document.getElementById('tracksBody');

    var trackNumberInput = '<td><input type="hidden" name="trackNumbers[]" value="" /></td>';
    var trackTitleTd = '<td><input type="text" name="trackTitles[]" /></td>';
    var trackLengthTd = '<td><input type="text" name="trackLengths[]" /></td>';
    var deleteButton = '<td><div onClick="this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);updateTracks();"></div></td>';
 
aaaa
i've got you
so i cant't have this code in external file?
 
yes you can
the jsfiddle problem doesn't matter in your website
 
do you know how?
 
the code works
<script type="text/javascript" src="./myscript.js"></script>
 
1:21 PM
no, it doesn't work!
yes i know that
 
have you checked your console for errors
 
know, I hear about it for first time
no*
 
are you in google chrome?
 
yes
 
ok so just press F12
then at the bottom there is like small icons
 
1:23 PM
wait
 
second from the left expands the console
 
i'm on notebook, F12 is wi-fi
 
yeah just press it
I mean, the F12, without fn button held down
 
no, it doesn;t work
ok
works
you meant inspect page)
 
you know of inspect page but not console? :|
 
1:25 PM
yes :D
 
jesus
anyway
at the bottom
 
haha
 
there is icons
second from left opens up console
left of the magnifying glass
 
yes
 
click it and the console should open
in the console, write 1+1 and press enter
 
1:26 PM
2?
 
cool
so now, go to your page, with the console open for that page, and do stuff
it should list any errors that are happening
 
i see
the same
i have my code in external file
<script type="text/javascript" src=../utils-tracks.js"></script>
 
yeah it doesn't matter where the script is
go to your page, with console open, and click stuff or whatever and you will see javascript errors
 
The stuff? the scripts
 
Uncaught SyntaxError: Unexpected token ILLEGAL on the same page
 
1:29 PM
congrats
on the right of that error message, it should link you to a line number
 
yes, the last one
 
So look there
 
just "}"
 
ok so either find the syntax error or paste it here
 
i have just end bracket
 
1:30 PM
what do you mean you have just end bracket
 
the last line
only "}"
 
try taking it away
 
the jsfiddle doesn't have syntax error
paste the code that the console said has syntax error
 
}​
this is the code :D
on the 18th line
the end of function
 
how can there be 18 lines if there is just }?
paste those 18 lines
 
1:32 PM
i posted them on jsfidle
all the lines
look there
the end of updateTracks function is on the 18th line
 
there is no syntax error in jsfiddle so the code in jsfiddle is not the same
 
function addTrack() {
var tracksBody = document.getElementById('tracksBody');

var trackNumberInput = '<td><input type="hidden" name="trackNumbers[]" value="" /></td>';
var trackTitleTd = '<td><input type="text" name="trackTitles[]" maxlength="128" style="width:225px;" /></td>';
var trackLengthTd = '<td><input type="text" name="trackLengths[]" maxlength="6" size="7" /></td>';
var deleteButton = '<td><div onClick="this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode);updateTracks();" class="iconContainer float-right" title="Remove this track"><div class="ui-icon ui-ic
 
there is an invisible character at the end
are you using a proper text editor?
 
@Esailija any experiences with node.js ?
 
dreamweaver
IT WORKS
 
1:34 PM
node.js is installed @ 0.6.18
 
dreamweaver is not a text editor
 
node-waf not found
.. wtf ?
 
an invisible char
 
@Abhishek wut, yes I have written chat in node
 
Yeah
 
1:35 PM
thank you man! :))
 
@Hypn0tizeR yeah if your text editor doesn't show that invisible char as "?" or whatever.. it sucks :P
 
so help me with node-waf (XD)
 
wtf is node-waf
node waffles?
 
its something that allows you to compile binary modules
with node.js
 
@Esailija, but now I know how to use the console!
 
1:36 PM
yeah it's good to eliminate all errors in console before asking question
@Abhishek I dunno, never heard of it
 
nvm then ^_^
i am trying to write pure c++ modules with node.js
turns out my decoder was 203% slower then libmpg123
 
1:49 PM
@Esailija, how to show in that span the values of each trackNumbers input?jsfiddle.net/zd6Wp/8
 
the same way as with inputs: jsfiddle.net/zd6Wp/10
 
ok, understood the add! generally, can you recommend some good books to learn javascript from a to z?
 
Javascript: The Good Parts
but that has nothing on DOM
maybe secrets of the javascript ninja
 
Thanks man a lot!
only good reviews on those
@Esailija, Do you have facebook?
 
2:05 PM
no
 
2:17 PM
is there a way to define this thing? this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode)
I want to write in onClick something else shorter instead of this, is there a way?
 
in jQuery $(this).closest("tr").remove()
 
not in jquery :(
so i can;t just declare a variable and then use it?
 
newsflash: this is why people use jQuery
because this.parentNode.parentNode.parentNode.removeChild(this.parentNode.parentNode) doesn't really EXPRESS anything
 
yes, you are right, in jquery of your prev post i understood everything
 
no you can't declare a variable, at best you might make a function that does .closest()
at which point you will just reinvent jQuery slowly
though I suppose that's good if you want to learn
 
2:21 PM
I want to try to learn first pure JS, and then jQuery
 
well here's your first opportunity to do just that
write a .closest function
 
already writing
 
hint: for this purpose you can do it in 3 lines pretty much
 
i know, i'm trying to do it just by returning that line
 
don't cram it in that line, make general purpose functions so the onclick looks clean like
remove( closest( this, "tr" ) );
 
2:31 PM
@Esailija nice challenge for him :-)
 
if you just put the code in onclick, it will look just as ugly as .parentNode spam
 
@Esailija whats your opinion on abit editing
like
Element.prototype.removeMe = function(){
this.parentNode.removeChild(this);
}
 
wonderful but not supported in IE :P
also I do this
function remove( elem ) {
	if( elem && elem.parentNode ) {
		elem.parentNode.removeChild( elem );
	}
}
 
:-)
 
so it doesn't cause an error
 
2:33 PM
wiat
an element can exist without a parentNode
.. no wait it can
 
yes it can but at that point there is no reason to remove it
 
@@TomShreds if you have any other issues with ncore let me know
 
lol you have file for each function
 
@Raynos any suggestions with node-waf ?
on my fedora i have node @ 0.6.18 but no node-waf
 
what node-waf ?
Use gyp or whatever it is
@Esailija it's called being modular
 
2:48 PM
yea it's modular all right :D, you could make it even more modular and make each character its own file
 
@Esailija it's mainly used for conditional file loading
I check which functions are missing and then build a file containing only those functions
so having one function per file allows building up a new file of functions in an easy manner
 
where is the one file that contains those functions together as a module
 
the server does all the magic
then writes it directly to the client
 
yeah I found it just as I Asked :D
 
the file only exists in RAM and disk temporarly
 
Sam
3:03 PM
Hey, is anyone able to help with my google maps question? Its here stackoverflow.com/questions/10866098/…
 
@epicsyntax its easy
 
3:19 PM
@Abhishek then please , help
 
@epicsyntax coding
just gimme like 10 seconds
 
@Abhishek of course, take ur time
 
@epicsyntax 99% done
 
@Abhishek ok waiting
 
@epicsyntax that what you need ?
 
3:26 PM
No no.. Not on hover. But always.
It's something like notification
 
you can pretty much change the
a:hover
to
a.notify
then it will only use that when you are notifying
and wait like 20 more seconds i will add something to show the numbers
with css
 
@Abhishek I want to get this like always on. Not on hover
 
3-4px right border too please and. With inset shadow
 
sure
then i will post the answer on SO
 
3:30 PM
ok
@Abhishek THX very much man
 
@epicsyntax i am still trying
to find where ur original borders occur from
 
@Abhishek ul li
 
@epicsyntax those hover effects :-/
idk how to tackle em
putting a border is as easy as
hell
 
@Abhishek any success?
 
now see in all those <a>
tags where u put data-number=[a value]
it will show the triangle :-)
so thats progress lol
cause i saw in some of your links it wasnt [in the image you showed]
i cant find where it hovers bro sorry :-(
 
3:44 PM
Here is hover
#navigation li:hover:after,
#navigation li.selected:after,
#navigation li:target:after{
    /* This property triggers the CSS3 transition */
    opacity:1;
}
 
dosnt makes a sense to me
what is it unhiding ?
another pseudo element ?
btw i posted the answer
and i hope you should be able to handle the hover
0
A: Styling navigation menu with CSS3

AbhishekHere we go http://jsfiddle.net/DBzSD/11/ I have used CSS pseudo elements to display them you can replace with normal elements if you want but that wont be a very wise choice. Secondly i have used the data-attribute to show the value of the number , you can dynamically change the number with ve...

 
@Abhishek It simply, increaces opacity with css3 fade animation
 
i dont get it (XD)
would make more sense if i would know whose opacity
 
Tell me, what you wanna do with hover?
 
idk
i dont even see a difference when hover occurs :-S
brb i need diner
 
3:48 PM
@Abhishek thx bro
 
@@TimDown for shame
 
hi all....i want to know whether jquery is Client side or server side?
 
4:05 PM
devil side
 
:D
@Esailija, Why I can't just use
function deleteTrack() {
var tracksBody = this.parentNode.parentNode.parentNode;
var child = this.parentNode.parentNode;
tracksBody.removeChild(child);
}
and move on
 
that's just as ugly though
 
it is the same as you typed, just divided
 
and it won't work like that
what do you think this is, it's completely meaningless now that it's inside a global function
 
hi all....i want to know whether jquery is Client side or server side?
 
4:12 PM
what do you think
 
ok @Esailija, got you, I must use something else but not "this", right?
 
onclick="deleteTrack(this);"
function deleteTrack( elem ) { ... }
this will only refer to the element in the onclick="" text
but you can just pass it to deleteTrack like that
and it will get it as argument known as elem
 
is any one here?
 
got you
 
4:31 PM
0
Q: Store variables function-wide and access them in an anonymous function

ComFreekAt the moment, I have this code: (function() { var lastSelectedIndex = -1; function eventListener() { // #selType is a <select> tag var selType = document.getElementById("selType"); // finished accepts two arguments: onSuccess and onError loader.finished(function(data) ...

 
 
2 hours later…
6:25 PM
@Esailija, how to remove each element? Can't find the answer
 
what do you mean?
 
function deleteTrack(track) {
var disc = this.parentNode.parentNode.parentNode; // Tracks Body
var track = this.parentNode.parentNode; // track TR

disc.removeChild(track);
}
 
to remove an element, element.parentNode.removeChild(element)
what is this inside your function?
it should be track, not this
as in, track.parentNode.parentNode.parentNode
 
HAHAHA it works :D
lool
thanks
understood at all!
I did a function which allows me to use $ instead of getElementById :))
 
StackOverflow just experienced an server error
 
6:34 PM
0
Q: Set Featured Image programmatically (in admin) with JavaScript?

Zach LI'm building a site for a music venue with a custom "event" post-type. Most of the time these events are unique, but there are some recurring ideas (for example, open mic night most tuesdays). I was thinking I'd like to put in a dropdown with some "presets" to populate the add new event form ...

 
 
:)
 
@Raynos thx, it's now working as it should :-D
 
7:10 PM
[].map.call(Array(25).join(), function () {
    return parseInt(Math.random() * 10, 10).toString()
}).join("")
 
@Esailija, jsfiddle.net/ppYtN/22 how to do my disc number to grow up and the addTrack funtion to work particularly for each disc?
I don't know how to refer to each disc particularly to add tracks in it
 
7:30 PM
oh wait, I use parentNodes
 
@TomShreds aweshum
 
 
1 hour later…
9:04 PM
How to get the penultimate element?
the last but one element
in pure js
in jquery there is a prev() function, what about pure js?
 
9:21 PM
hey
He is very annoying, how can I block him?
 
9:49 PM
@Derek delete your answer, problem solve :D
 
@Raynos \o
:D
sessionStorage clears out when you close but not when you refresh
maybe you can work out a hacky solution using that fact
@Derek :P
 
10:23 PM
Good night everyone! Have a small question. Is there some sertain way to get selected text from i.e. textarea element? I did find some solutions involving selectionStart and selectionEnd properties of a DOM Object, but I'm not sure, that any of those methods work in all browsers. Maybe some of you can suggest some definitive solution.
 
10:49 PM
@Raynos LOL
 

« first day (596 days earlier)      last day (4355 days later) »