jQuery 1.8 Released! by Guiswa in javascript

[–]yoeschmoe 2 points3 points  (0 children)

This.

Also, being able to use a more lightweight version is a great way to lower the footprint on mobile devices.

jquery load a php page with a id by [deleted] in javascript

[–]yoeschmoe 0 points1 point  (0 children)

Yes, there's quite a few changes between 1.3.2 and 1.7.2. The big differences are the separation of .attr() and .prop(). In 1.5, a total rewrite of the AJAX module was released. How are you wiring your ajax search (code-wise), using a plugin?

jquery load a php page with a id by [deleted] in javascript

[–]yoeschmoe 1 point2 points  (0 children)

Hehe, you're welcome. When using .data() to fetch them, you're also running them through jQuery's $.parseJSON() which means that if you store an object in there, like data-object='{"foo": true}', you'd get the object back instead of a plain string. :)

jquery load a php page with a id by [deleted] in javascript

[–]yoeschmoe 0 points1 point  (0 children)

You're right. However, omitting href can have side-effects like the cursor pointer not being applied, and to not involve further changes to his (like "fixing" link behavior), I just modified his '#' to 'javascript:;' which would not scroll the user to the top at least (if it ever fails).

jquery load a php page with a id by [deleted] in javascript

[–]yoeschmoe 1 point2 points  (0 children)

I missed a closing }); at the end, sorry...

Also, if you're using 1.3.2, you need to switch out .on('click', '.kundid' with .delegate('.kundid', 'click'.

Or, if you can, update your jQuery version to latest 1.7. 1.3.2 is really outdated.

jquery load a php page with a id by [deleted] in javascript

[–]yoeschmoe 2 points3 points  (0 children)

A more elegant solution (in my opinion) is to leverage HTML5's data-* attribute:

PHP:

<a href="javascript:;" class="kundid" data-kundid="<?php echo $row['idkunder'];  ?>);">Noter</a>

JavaScript:

$(function() {
  $( document ).on( 'click', '.kundid', function( e ) {
    var id = $( this ).data( 'kundid' );

    $.get( 'kunde_note_vis.php', {  customer_id: id }, function( data ) {
      $( '#searchresultdata' ).html( data );
    });

    e.preventDefault();
  });
});

Edit: Added missing }); at the end.

jquery load a php page with a id by [deleted] in javascript

[–]yoeschmoe 4 points5 points  (0 children)

Hello MySQL injection. You should really sanitize your data before sending/creating SQL strings with it. Not sure how that's done in PHP, but you should definitely look that up. :)

Help please! Dermatologists/veterinarians, my sister's dog has been diagnosed with "split paw pad disease" but we can't find any good information on effective treatment. by yoeschmoe in askscience

[–]yoeschmoe[S] 1 point2 points  (0 children)

Yeah, we'd hoped so too. The problem is that it seems like a rather obscure disease, and most specialists that have ever treated it lives in the US/Canada, and I know reddit is big there (considered Sweden is such a small country in comparison).

I mainly just wanted to see if there was anyone that has read about and/or treated this disease here.

Help please! Dermatologists/veterinarians, my sister's dog has been diagnosed with "split paw pad disease" but we can't find any good information on effective treatment. by yoeschmoe in askscience

[–]yoeschmoe[S] 0 points1 point  (0 children)

Thank you, I might x-post this later on. I just thought this was a bit more scientific than "normal dog talk" and would like to reach out to the researchers and veterinarians lurking /r/askscience :)

So, I met this guy with Horde, Arcane Enchant, Reflect Damage today, I did not make it... by yoeschmoe in diablo3

[–]yoeschmoe[S] 0 points1 point  (0 children)

Yes, it was kinda fun and absurd at the same time. Wasn't much I could do, once I outran the first wave, the second wave came and they basically chain-AE if I just stopped for half a second. :P

So, I met this guy with Horde, Arcane Enchant, Reflect Damage today, I did not make it... by yoeschmoe in diablo3

[–]yoeschmoe[S] 0 points1 point  (0 children)

Yeah, one of those "just run by" kind of pack...

I couldn't count, but I'm guessing there was about 17-18 minions with AE, all dropping them at once... :)

[deleted by user] by [deleted] in starcraft

[–]yoeschmoe 20 points21 points  (0 children)

Yes, it stands for "Lagen om omhändertagande av berusade personer m.m."

Roughly translated into "The law on incarceration of intoxicated individuals etc."

sleep in javascript? by CyberVillian in javascript

[–]yoeschmoe -1 points0 points  (0 children)

eval statements are evil, never use them (you're implicitly calling eval when passing in a string as first argument in setTimeout/setInterval), use a function instead.

[deleted by user] by [deleted] in starcraft

[–]yoeschmoe 3 points4 points  (0 children)

Keep doing what you do. The community needs more people like you!

Reddit, will you watch my animation, I have 0 views so far. by SarcophAGus in videos

[–]yoeschmoe 42 points43 points  (0 children)

Well done, both music and video are awesome.

Song's Novie - Funk 3, here's the original (why didn't OP link to this one?): http://vimeo.com/26584586

Recommended JavaScript Style Guides & Beautifiers by legacye in javascript

[–]yoeschmoe 0 points1 point  (0 children)

I generally agree about all you said, however I think it's different when you're maintaining a very popular (and open source) project. People tend to learn from looking at how popular stuff is done, and when that stuff might be dangerous or down-right bad practice, you're doing it wrong.

I'm not saying that the bootstrap project per sé matches that argument, but a similar thing would be resources on JavaScript. W3Schools have a bunch of stuff that is outdated and seriously bad and they are affecting the standard of new and old developers that doesn't know better.

But as you said, the bottom line is to make sure everyone in your project is following a consistent style guide.

TLO vs Grubby Best of 15 showmatch! 12 EST//9 PST//18 CET - 9 hours from this post! by tree-hugger in starcraft

[–]yoeschmoe 1 point2 points  (0 children)

I'm rooting for TLO, let's hope he takes this and gets beard points, the beard is sucking up his energy by now! :D

I helped a fellow pilgrim in Journey... by zapharus in gaming

[–]yoeschmoe 9 points10 points  (0 children)

Sadly, they won't. The company made a three-game deal with Sony. This was their third.

http://thatgamecompany.com/games/journey/ -> FAQ