« first day (54 days earlier)      last day (4912 days later) » 

Tek
10:07 PM
@Greg Someone beat you already :(
 
@Tek they won't have as good answer as me ...
 
Tek
Oh? Lets see it
 
10:17 PM
damn
took all that time writing it and its almost the same as the other guys'
@Tek I thumbed up your question
 
Tek
LOL
thanks
Show me anyway? :)
 
@Tek i replied to your question
@Tek i notice nobody else said how to fade out the other elements, but rather how to fade in the hovered element
 
Tek
@Greg Is it bad that I can't tell the difference? lol
 
@Tek ahhhhh, no its not bad, just thought my question should show how to do it the way you asked
 
Tek
@Greg That's what I mean, both ways seem to be able to do what I ask. I can't tell teh difference between the effects is what I mean.
 
10:30 PM
Hi guys
Alright, been messing with the jquery ajax thing, still stuck a bit.
Both downvote and upvote arrows do an UPVOTE right now
But the ajax part isn't working
if i go directly to the PHP submit page, works fine and counts the vote
<a href="#" class="redup" onclick="jquery.get("./vote.php?id=1", function(data) { jquery("#numberwrapper").text(data); });"></a>
 
@MALON your quotes are hosed in your HTML
 
How do I style code for readability here?
 
@MALON do you intend them to do that?
@MALON use a backtick for short segments `
for longer segments
that involve a linebreak
such as this, when you have
multiple linebreaks, you'll see a button to the right during edit ->> [fixed font]
 
I mean your onClick is surrounded by doublequotes but it contains doublequotes.
you'd be lucky if any browser handled that well
 
Yeah, I just fixed the quote/double quote issue
 
10:36 PM
refreshes
 
Ok, now both are fixed
upvote and downvote quotes i mean, not the fact that they both do an upvogte
upvote
 
Tek
@MALON A clearner/better solution would be to get rid of the *onclick=* give the anchor links both IDs and inside <script></script> with jquery you could do something like:

$('#upvote').click(function(){

$.get('ajax/test.html', function(data) {
$('.result').html(data);
alert('Load was performed.');
});

)};

$('#downvote').click(function(){

$.get('ajax/test.html', function(data) {
$('.result').html(data);
alert('Load was performed.');
});

)};
 
so... they're calling the same URL, how do you expect one to know it's a down vote?
 
@Tek where have I seen something like that suggested before? ;) chat.stackoverflow.com/transcript/message/184421#184421
 
I don't care at this point, I'll differentiate upvote and downvote simply with another GET var
Right now I just want to get ONE vote to work
If you'd like, I'll implement upvote and downvote
should be easy
 
Tek
10:38 PM
@drachenstern I overlooked that, but mine seems to be better formatted for readability. :)
 
@Tek only instead of giving anchor links ids, which doesn't let you have more than one at a time, give them classes
@Tek I wasn't trying for that tho ;) ~ But I do concede you that
 
Tek
@drachenstern They're not duplicate IDs, they do different things because they have a different link to be able to upvote
and downvote
 
@Nathan Ok, downvote and upvote work independently (but the colors of the arrows do not change). an upvote is just adding &upvote=true to th PHP GET var
 
@Tek if I put them in a repeater (a-la the SO frontpage) they would need a class, not if they were only one each on a page
 
I don't understand all this "do it at the top of the page with blanket jquery selectors" advice. Why not just have the server-side code emit voting links including the server-side ID(s)?
 
10:42 PM
@MALON so do you have any idea what's wrong?
@Nathan he wants ajax
 
I have zero idea what's wrong. The vote.php page is functioning as normal, but to ajax query it with the vars is failing me
 
jQuery('#numberwrapper').text() <-- works
jquery('#numberwrapper').text() <-- doesn't

Care to guess why?
this is why most people use $
 
Oh snap, capitalization
 
@drachenstern , isn't it still Ajax if the HTML says onClick="$.get('url?$id')" ?
 
know how I found it?
@Nathan yes, but again, how do you make it a list and still work like that?
if you're going to update after?
 
10:45 PM
YESSSSSSSSSSS IT WORKS
BOOYA
 
Tek
lol
congratulations? :)
 
That capital Q.....
 
congrats
 
@MALON in the future, unless you have a need to, call your jQuery methods with $ instead of jQuery
 
No prob
I love standards
 
10:46 PM
MALON knows how to USE ALL CAPS APPROPRIATELY ;)
 
Tek
Drats. @drachenstern beat me to it
 
@drachenstern, so if you have a list of multiple votable items, they still have one id in the database, right? So why not have the page render with onClick="$.get('vote.php?id=<?php echo $id ?>')" ?
that is, a different onClick call for each element in the list
 
does $ parse faster than jQuery, or does it just save you from having to download 5 extra bytes every time?
Also, I didn't realize the terms $ and jQuery were synonymous in code...I never knew wtf $ meant actually, i just knew it was required when coding
er, when using jquery
 
Tek
It just makes your life easier :)
 
$ is not magic in javascript like in PHP etc, it's just a name.
 
10:50 PM
Yeah, I know it's only jquery related
 
Tek
lol @ magic
 
some other libs use it too... prototype/scriptaculous iirc
 
Tek
jQuery = $ monay :D
'cause you know, it makes fancy things that gets you paid...
 
maybe they should've named it $jMoney
 
Tek
LMAO
dunno why that cracked me up so much
 
10:52 PM
So, now that I've got it working, what would be a good way to implement it? having the jquery in the onclick tag sort of feels like using style=
 
Tek
yup
we told you earlier
15 mins ago, by Tek
@MALON A clearner/better solution would be to get rid of the *onclick=* give the anchor links both IDs and inside <script></script> with jquery you could do something like:

$('#upvote').click(function(){

$.get('ajax/test.html', function(data) {
$('.result').html(data);
alert('Load was performed.');
});

)};

$('#downvote').click(function(){

$.get('ajax/test.html', function(data) {
$('.result').html(data);
alert('Load was performed.');
});

)};
 
yeah, i scrolled back up to read it....totally spaced you sent that
Sorry 'bout that
 
Tek
then for html it would be something like <a id="upvote"></a>
no problem, it's good that you read it after you got your script to work, didn't want to confuse you
 
I prefer it inline. For the same reason that it would be dumb to have a bunch of empty HREF elems that you populate with jQuery's onLoad.
 
Tek
he could have <img id="upvote">
 
10:55 PM
I'll probably put it in an external js file actually, just because i like external the most
 
but i'm sure that's just imho
 
Tek
instead of links with the click function
@Nathan Is that a better suggestion?
 
how about <a onClick="voteUp(<?php echo $id ?>"> that calls a function you define?
 
Tek
The point is to keep html clean, which is why external files exist
imagine all the PHP and javascript all together
inline
It's just really messy.
 
This is a pretty sweet chat/shoutbox..you'll probably see me around from time to time, but for now, I gotta jet guys. Thanks for everything!
 
10:57 PM
but hrefs aren't messy?
 
Tek
@MALON no problem, see ya around
 
bye @MALON
 
Tek
@Nathan Why have <a> and hrefs when you can have cleaner html and have all the functions in a JS script?
 
well, for unobtrusiveness you could have the hyperlink point to a javascriptless roundtrip voting mechanism, for example.
 
Tek
brb one sec
 
11:02 PM
@Tek I think that would be like <a href="vote.php?id=<?php echo $id ?>&up=true" onClick="voteUp(<?php echo $id ?>); return false;">
 
Tek
11:16 PM
you forgot that there's an img inside of that link
we could forget about the anchor link and just do:
<script>
$('#vote').onclick(function(){
voteUp(<?php echo $id ?>);
});
</script>

<img id="vote" src="link.png" />
only 9 more characters added to the html instead of a whole anchor link that is a little less friendly to read
 
I ASCEND FROM THE SKIES
sorry, I love that animation
 
Tek
I tried googling it, first link I found was just ridiculous.
lol.
@SaraChipps What animation are you talking about? Searching for the quote didn't help much...
You can use XPath selectors in jQuery?!?lfiajsdf That's too awesome.
 
11:57 PM
@Tek, lol, I meant when you enter a chat room and your av floats down
 
Tek
av as in antivirus?
 

« first day (54 days earlier)      last day (4912 days later) »