Go Back   CodingForums.com > Search Forums

Before you post, read our: Rules & Posting Guidelines

Showing results 1 to 25 of 375
Search took 1.20 seconds.
Search: Posts Made By: Airblader
Forum: JavaScript programming 06-11-2013, 06:20 AM
Replies: 11
Views: 296
Posted By Airblader
Maybe it's just too early in the morning for me,...

Maybe it's just too early in the morning for me, but shouldn't the condition be flipped?

for(i = 0; i < chackMail[0].length; i++)
Forum: JavaScript programming 06-06-2013, 02:58 PM
Replies: 1
Views: 124
Posted By Airblader
My car works fine at home, but as soon as I leave...

My car works fine at home, but as soon as I leave my house it starts acting up. If you tell me what's wrong with my car, I'll help you.
Forum: JavaScript programming 06-02-2013, 09:58 AM
Replies: 4
Views: 238
Posted By Airblader
Do you know the meaning of the word...

Do you know the meaning of the word "copyright"?
Forum: JavaScript programming 05-30-2013, 05:34 PM
Replies: 23
Views: 495
Posted By Airblader
Thanks, I'll check that out when I get the chance...

Thanks, I'll check that out when I get the chance to!
Forum: JavaScript programming 05-27-2013, 07:33 PM
Replies: 15
Views: 475
Posted By Airblader
No response to my addition? Disappointing.

No response to my addition? Disappointing.
Forum: JavaScript programming 05-26-2013, 07:08 PM
Replies: 15
Views: 475
Posted By Airblader
You can replace the msg variable in his script...

You can replace the msg variable in his script with

function a(b) {
return b.replace(/[a-zA-Z]/g,function(c){return String.fromCharCode((c<="Z"?90:122)>=(c=c.charCodeAt(0)+13)?c:c-26);})
}
...
Forum: JavaScript programming 05-24-2013, 09:28 PM
Replies: 23
Views: 495
Posted By Airblader
Maybe that's what V8 compiles it into, but V8...

Maybe that's what V8 compiles it into, but V8 certainly doesn't allow me in my role as a js developer to write some inline Assembler into my code – or did I miss such a big thing?
Forum: JavaScript programming 05-24-2013, 06:50 PM
Replies: 3
Views: 169
Posted By Airblader
@ WolfShade That's non-sense and will return...

@ WolfShade

That's non-sense and will return "What better employment than undefined".

If the string you want to output is constant, why not just do

var trade = function() {
...
Forum: JavaScript programming 05-24-2013, 01:58 PM
Replies: 23
Views: 495
Posted By Airblader
Since the discussion already went low-level: How...

Since the discussion already went low-level: How awesome would it be, if we could use inlined Assembler in Javascript?
Forum: JavaScript programming 05-23-2013, 04:04 PM
Replies: 23
Views: 495
Posted By Airblader
Why don't you just try it? Generally spoken,...

Why don't you just try it?

Generally spoken, infinite loops (with a hidden break statement inside) are considered very bad practice with few exceptions. There is almost always a better way.
Forum: JavaScript programming 05-22-2013, 11:15 PM
Replies: 31
Views: 610
Posted By Airblader
Yes, of course, I was typing a little too fast....

Yes, of course, I was typing a little too fast. Thanks. :)
Forum: JavaScript programming 05-22-2013, 08:06 PM
Replies: 2
Views: 176
Posted By Airblader
I might be misunderstanding something here, but...

I might be misunderstanding something here, but don't you wanna do

var el = document.getElementById("testid");

instead? Your comment suggests that "testid" is the id itself, not a variable...
Forum: JavaScript programming 05-22-2013, 08:04 PM
Replies: 19
Views: 276
Posted By Airblader
Here you can see that it works:...

Here you can see that it works: http://jsfiddle.net/CduVH/

If i goes out of bounds, story[i] will return undefined. Since that is a falsy value, the or will be triggered which will then use...
Forum: JavaScript programming 05-22-2013, 07:54 PM
Replies: 31
Views: 610
Posted By Airblader
Oh, yeah. Thanks. Just goes to show how much I...

Oh, yeah. Thanks. Just goes to show how much I watch out to not even let it come to such a division.



You can, but I don't encourage you to. If you absolutely want to use the for..in loop, then...
Forum: JavaScript programming 05-22-2013, 11:27 AM
Replies: 31
Views: 610
Posted By Airblader
There really isn't any need to name the function...

There really isn't any need to name the function twice, by the way.

$scope.calculateTotal = function () {
...
};

will work just fine. Also, in advance, this will throw an error:

return...
Forum: JavaScript programming 05-21-2013, 09:16 PM
Replies: 8
Views: 193
Posted By Airblader
Challenge accepted! document.getElementById...

Challenge accepted!

document.getElementById = function () { alert('h4ckz0r3d'); };
(function () { /* your code */ })();

But then again, if that were to happen, throw away that piece of code...
Forum: JavaScript programming 05-21-2013, 12:06 PM
Replies: 31
Views: 610
Posted By Airblader
:thumbsup: If you have troubles managing...

:thumbsup:

If you have troubles managing your local variables, your scope (function) is too big. Period. In fact, it will become too long way before that happens.
Forum: JavaScript programming 05-21-2013, 07:56 AM
Replies: 12
Views: 203
Posted By Airblader
@ Old Pedant I guess you're right -- a toy...

@ Old Pedant

I guess you're right -- a toy system with only local storage should be fine using the names as the PK. :)
Forum: JavaScript programming 05-20-2013, 10:40 PM
Replies: 31
Views: 610
Posted By Airblader
Okay, now I know what you mean. Yes, technically...

Okay, now I know what you mean. Yes, technically that isn't self-invoked, but it behaves the same. Noneof those two methods is better than the other.
Forum: JavaScript programming 05-20-2013, 09:59 PM
Replies: 12
Views: 203
Posted By Airblader
I don't know the project behind this, but if...

I don't know the project behind this, but if you're gonna use names as the primary key, you're likely to have a bad time pretty soon. Unless you can be 100% sure that names are unique, don't use them...
Forum: JavaScript programming 05-20-2013, 09:56 PM
Replies: 31
Views: 610
Posted By Airblader
All you did was remove to parentheses. The outer...

All you did was remove to parentheses. The outer function is still self-invoked, as can be proven by adding the alert inside:

var getCiao = function () {
alert("If I wasn't self-invoked, you...
Forum: JavaScript programming 05-20-2013, 02:59 PM
Replies: 31
Views: 610
Posted By Airblader
Okay, just to be clear, I will be referring to...

Okay, just to be clear, I will be referring to this code:

var getCiao = (function () {
var ciao = 1;

return function () {
return ciao;
};
})();
Forum: JavaScript programming 05-20-2013, 02:03 PM
Replies: 31
Views: 610
Posted By Airblader
No, it should become exactly what I wrote above...

No, it should become exactly what I wrote above (post from 2:00pm).
Forum: JavaScript programming 05-20-2013, 01:07 PM
Replies: 31
Views: 610
Posted By Airblader
By the way, there is a difference between using ...

By the way, there is a difference between using

return getCiao = function () { ... }

as you did in your first post and the way I assigned getCiao – yours will make it a global variable...
Forum: JavaScript programming 05-20-2013, 01:00 PM
Replies: 31
Views: 610
Posted By Airblader
Not quite, it would have to be (also note the...

Not quite, it would have to be (also note the parentheses surrounding the "function () { ... }")

var getCiao = (function () {
var ciao = 1;

return function () {
return ciao;
...
Showing results 1 to 25 of 375

 
Forum Jump

All times are GMT +1. The time now is 07:05 AM.