1
2
3
4
// container = element to put message into
// text = what you want the message to say
function msg(container, text) {
...

JavaScript On Ultra lightweight message &...

by Chris Brandhorst, September 02, 2010 13:52

Most jQuery functions retur...

7a927605596a2463b081c2f5cfcb24a9 Talk
1
2
3
4
// http://github.com/fjakobs/async.js

var async = require("async");
...

JavaScript On Node.js: Calculating total ...

by Fabian Jakobs, August 27, 2010 07:06

With async.js you can rewri...

A6d98536d90d2987d40a6abe731805ca Talk
1
2
var message = XMLHttpRequest.responseText;
message = (message.length > 0) ? (jQuery.parseJSON(message).error || t('messages.oh_no_error') : "";

JavaScript On Double 'if'

by Miguel, August 26, 2010 20:24

I think it works this way

972fe29d288b40be23449f27fb0bc3bc Talk

JavaScript On Double 'if'

by Ants, August 26, 2010 18:23

@Robert: Good job factoring...

F9a9ba6663645458aa8630157ed5e71e Talk
1
2
3
4
var message      = "",
    responseText = XMLHttpRequest.responseText;

...

JavaScript On Double 'if'

by Robert Dougan, August 26, 2010 00:22

I would do something like this

Ffb522eb0929d410d97214b01a4f3fc0 Talk
1
2
3
4
// http://github.com/creationix/step
var Step = require('step'),
    fs = require('fs');
...

JavaScript On Node.js: Calculating total ...

by Tim Caswell, August 26, 2010 00:04 Star_fullStar_fullStar_fullStar_fullStar_full

Use Step and path.exists is...

C953ddd239707998340e1a6fbb3eeb46 Talk
1
2
3
4
$(this).siblings('ul').slideToggle(300).end()
       .next().toggleClass('closed').end()
       .toggleClass('nav_arrow_light_up')
...

JavaScript On Simple jQuery script - Opti...

by arkilus, August 24, 2010 23:31

Regarding chaining, this sh...

A1ce281ac971bd75dc12349c40796b67 Talk

JavaScript On Double 'if'

by Adam, August 24, 2010 16:01

Good point. Like I have sai...

A8d3f35baafdaea851914b17dae9e1fc Talk

JavaScript On Double 'if'

by Ants, August 23, 2010 21:14

@Adam: Your refactoring cha...

F9a9ba6663645458aa8630157ed5e71e Talk
1
2
3
4
var message;

if (XMLHttpRequest.responseText.length > 0) {
...

JavaScript On Double 'if'

by Adam, August 23, 2010 19:26
A8d3f35baafdaea851914b17dae9e1fc Talk
1
2
3
4
(function () {
    function addHeading(obj) {
        var objType, h2, text;
...

JavaScript On console.log for ie

by paul.wilkins.myopenid.com, August 21, 2010 00:16 Star_fullStar_fullStar_fullStar_full

The major change here is re...

Aacfa176a8d73ca75b90b6375151765a Talk

JavaScript On Prevent Default not working.

by Anri, August 19, 2010 16:55

Hey Jacboc, I tested this i...

4058d6b5dc2bfd92fd7f7f9a13eb61a6 Talk
1
2
3
4
<script type="text/javascript">
	document.onkeyup = KeyCheck;       
	function KeyCheck(e){
...

JavaScript On Prevent Default not working.

by Jacob Relkin, August 19, 2010 16:29 Star_fullStar_fullStar_fullStar_fullStar_full
0135bb75b1f08484d26239e8117b111c Talk

JavaScript On jQuery plugin: add class to...

by HuiFungPung, August 06, 2010 03:50

Do you know any good new ma...

62a40ff1b5f93544112002e7c4220dc0 Talk
1
2
3
4

 $('.toggle').click(function(){
...

JavaScript On Simple jQuery script - Opti...

by naugtur, August 04, 2010 11:56

I didn't break it down to s...

C541838c5795886fd1b264330b305a1d Talk
1
2
3
4
<script type="text/javascript">
  $(document).ready(function() {
    
...

JavaScript On JQuery - snippet to select ...

by Casey, August 04, 2010 11:46
Avatar Talk
1
2
3
4
<script type="text/javascript">
  $(document).ready(function() {
    
...

JavaScript On JQuery - snippet to select ...

by Dharmang, August 03, 2010 09:37

I am using value of select ...

C67373bcc92b632e36856ee07dc9b5cb Talk
1
2
3
4
function _initCountUpUsers()
{
    var totalUsers, ceiling, floot, update;
...

JavaScript On Javascript Loop Refactor

by paul.wilkins.myopenid.com, August 03, 2010 03:18

You can use clearInterval f...

Aacfa176a8d73ca75b90b6375151765a Talk

JavaScript On how i make it work on Firefox?

by harakter, July 31, 2010 23:27

I would like to exchange li...

928b47489462b9301d8e7026d9b074cf Talk

JavaScript On print an image

by Sorpprattal, July 31, 2010 09:07

mrkpti, http://URBANWORSHIP...

9ba5c27ec55ef042d7efeeb3f631807b Talk
1
2
3
function dataStringToArray(str) {
  return JSON.parse( '[[' + str.replace( /\|/g, '],[' ) + ']]' );
...

JavaScript On Delimited data string to ne...

by Sean Catchpole, July 21, 2010 19:38

I know this is a little hac...

Avatar Talk

JavaScript On jQuery plugin: add class to...

by xXmikeGalXx, July 20, 2010 22:20

I'm trying to open forum bu...

558cd775e2af0294d243e78c83506a98 Talk

JavaScript On how i make it work on Firefox?

by tribadiainterna, July 17, 2010 01:27

it was very interesting to ...

928b47489462b9301d8e7026d9b074cf Talk

JavaScript On Delimited data string to ne...

by squidsoup, July 08, 2010 09:01

Wow, that's amazing Adam th...

8740fb2a869928fd0c39531902a83477 Talk
1
2
3
4
function dataStringToArray(string) {
    return string.split('|').map(function(segment) {
        return segment.split(',').map(function(digit) {
...

JavaScript On Delimited data string to ne...

by Adam, July 08, 2010 02:56 Star_fullStar_fullStar_fullStar_fullStar_full
A8d3f35baafdaea851914b17dae9e1fc Talk