« first day (14 days earlier)      last day (4941 days later) » 

1:18 AM
can anyone help me with a jquery issue
 
2:17 AM
@Alessandro I can try?
 
3:12 AM
chat...
when did this happen ;-)?
 
Not all that long ago..
 
3:39 AM
the word selector is completely ubiquitous
 
 
2 hours later…
5:11 AM

The SO Tavern (Free Snacks)

Room 5 was frozen for inactivity even though it was once an ac...
 
 
2 hours later…
7:11 AM
1
Q: cropping and ajax uploading

Rahul Mehtahi , i want to upload profile pic like facebook and ajax upload the image and crop with the fix size and ajax upload to server . in jquery ,php , how can i do it ? thanks rahul

 
 
2 hours later…
8:54 AM
8 messages moved to The SO Tavern (General)
 
9:10 AM
If I have
<table>
<tr>
<td><a id="blabla">click me to hide</a></td>
</tr>
</table>

How can i make the #blabla to hide the <tr> that #blabla is in? parent(). ?
 
@Johnson $('#blabla').click(function(){$(this).closest('tr').hide()});
 
@Yi Jiang thank you
@Yijiang *
 
lo Yi
 
If i have an normal counter, e.g "Today (10)", how can i decrease that amount along with when you hide a tr
brb asking this question on SO
 
9:35 AM
0
Q: JS: Counter decrease, at hide()

JohnsonIf I have a normal <?php echo "Today (".mysql_num_rows($query)."); ?> That turns out as Today (10) if there's 10 rows. Now under this counter I have an while() that outputs all the rows inside a <tr>. In a <td> inside the tr i have this delete button, which hides closest '...

 
Nice how did it end up here
 
@Johnson Obvious answer: Andy E looked at your profile and dropped the question here
 
@Yijiang how do you make it like a snippet like he did
0
Q: JS: Counter decrease, at hide()

JohnsonIf I have a normal <?php echo "Today (".mysql_num_rows($query)."); ?> That turns out as Today (10) if there's 10 rows. Now under this counter I have an while() that outputs all the rows inside a <tr>. In a <td> inside the tr i have this delete button, which hides closest '...

nice you just post a link :P
 
 
3 hours later…
12:32 PM
I've always got a nagging feeling that the [javascript] tag wiki stackoverflow.com/tags/javascript/info is incorrect, somehow
Wonder if anyone here would mind editing it
 
1:03 PM
@YiJiang What's wrong with it? It looks OK to me.
 
@Pointy The first line "JavaScript is the common name for ECMAScript" I'm not very familiar with the specs, but isn't ECMAScript the base upon which a number of languages, including Javascript were created?
 
1:18 PM
@YiJiang Yes, but if you were going to pick a "common" name, I think "Javascript" would be it. Even Windows people call JScript "Javascript".
To put it another way: it would be silly for the name of the tag to be "ecmascript" because nobody would use it, particularly not the extreme newbie people trying to do wild things with a language they don't know yet
Also it really was "JavaScript" first - it sort-of popped out of Netscape suddenly. The spec came later.
 
 
4 hours later…
5:22 PM
What would be the best way to go about making a scroll bar through pure JS? Would it be feasible to draw it to the canvas element - if so how can you detect events on objects drawn to that?
 
 
2 hours later…
7:33 PM
Does anyone have any idea why document.getElementsByTagName('select')[0].options would return a collection of option elements in Firefox but not in Chrome? The options property appears to be in the HTML DOM -- is this a Chrome bug?
 
Tom
7:55 PM
Hi, could anyone tell me why this results in a this.onTextChange() is not a function?
gist: 655681, 2010-10-30 19:55:13Z
//register change event
	this.element.change(function() {
		this.onTextChange();
	});
	
	this.onTextChange = function() {
		//this.value = $(this.element).val();
		//console.log("text val: " + this.value);
	};
(this is code inside object construction)
 
can anyone tell me how can i get the no. of options in jquery combo box. ie. myCombo = $('#combo1'); now how to find no. of options in myCombo
 
@KoolKabi You posted a question about that earlier -- it has several viable answers
1
Q: how do i find the length of options in a combo box

KoolKabinhi guys How can i know is there any options in a combobox/selectbox or not? small Edit: i have my comboxbox as myCombo = $("#country"); now i want to know how many options are there in myCombo

 
@lonesomeday small prob in that one... i updated my question. i got solution which is quite in appropriate in my case.
@lonesomeday everybody suggested $('#combo1 options).length but i want it from prev jquery object like myObj = $('#combo1'); .... alert('no of options : ' + myObj.???);
 
@KoolKabin So you have myCombo = $("#country") and you want to find out how many option tags #country contains?
 
yeah
 
8:03 PM
@KoolKabin myObj.length
 
Tom
KoolKabin: $(myCombo).children("option").length
 
hm.. i m trying that tom
thnx
 
Yes, what I wrote is nonsense
You don't need the extra jQuery selector, though -- what you have is already a jQuery selection -- you need to do myCombo.children('options').length
 
@lonesomeday again not working
@tom not working.... getting error
 
What's the error?
 
8:06 PM
@KoolKabin, jsfiddle.net
'not working' is not a valid description of a programming problem.
4
(:
 
@rchern Although it is a valid description of most programmers most of the time!
 
.length is not a function
 
@KoolKabin Don't do .length(), do .length instead -- it's a property not a function, so it doesn't need the brackets
 
seriously, if someone wants help, "not working" should not be in the question anywhere
 
ok
 
Tom
8:11 PM
Am I missing something here? Getting a function this.onTextChange is not defined, code is part of object construction
gist: 655681, 2010-10-30 19:55:13Z
//register change event
	this.element.change(function() {
		this.onTextChange();
	});
	
	this.onTextChange = function() {
		//this.value = $(this.element).val();
		//console.log("text val: " + this.value);
	};
 
now always returning 0
 
@KoolKabin As @rchern said, show us an example -- jsfiddle.net is an easy place to do that
 
jsfiddle.net/3KrYv here is my code
 
you have .length()
5 mins ago, by lonesomeday
@KoolKabin Don't do .length(), do .length instead -- it's a property not a function, so it doesn't need the brackets
 
i updated it to length
 
8:14 PM
though () are parentheses, not brackets (;
then link us to that jsfiddle, not an outdated one
 
already done so after that its returning 0 everytime
here is the updated one
 
Tom
@KoolKabin it is option not options
 
@Tom Good spot
 
Tom
$jsontwo.children('option').length
 
hm...
thnx ... it helped
now worked fine
thnx guy
some suggestions for its code improvement?
 
8:20 PM
@KoolKabin Putting the $("#json-one").change in the $(document).ready() block would be a good start
 
thnx.... i will take care of it...
 
Tom
Did anyone read my question? :)
 
@Tom, if that was sufficient I'd not have asked for something else.
it doesn't show the context of the code.
and it isn't a live demo (;
 
Tom
8:36 PM
@rchern, hmm, I'll try to make a working jsfiddle
@rchern, I can't get it to work on jsfilddle, jsfiddle.net/4RXV9
it's not creating the text area there (it is on my own version)
 
@Tom Try loading jQuery! Use the menu on the left-hand pane.
 
Tom
@lonesomeday, @rchern, updated: jsfiddle.net/4RXV9/1
Firebug tells me that this.onTextChange is not a function
 
@Tom That's because, in the context of the event handler, this refers to the DOM element -- the textarea in this case.
 
that's because you're trying to call it on a html element.
thought that's what it was but without the larger context hard to be certain
 
Tom
hmm, alright, so how do I get this instance of the object @lonesomeday, @rchern?
 
8:51 PM
@Tom You could save a reference to the instance: jsfiddle.net/lonesomeday/HUvV4/1
I've used confusing nomenclature, though -- use a better name than _this. I don't understand your architecture enough to work out what that might be.
 
Tom
@lonesomeday, alright, thanks a lot - how do I know when this inside functions refer to something else than the object?
 
@Tom It's often tricky working it out. Doing console.log(this); can often make things clearer.
 
Tom
@lonesomeday, hmm alright, seems awkward though
 
do you really need to name your functions this.functionname ?
 
Tom
rchern, what else? they need to be available publicly, so yes
 
9:08 PM
Hi guys, I was just wondering if someone with a browser other than Fire Fox would basically try to break my JavaScript library? All I have is Fire Fox on my Ubuntu so someone with IE would be best.
I need to find as many bugs as I can.
Well anyway, heres the link and if you find something I would appreciate it if you stuck it in the issues section, thanks! github.com/Wolfy87/Spark
 

« first day (14 days earlier)      last day (4941 days later) »