dcsimg
www.webdeveloper.com

Search:

Type: Posts; User: Kever

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Not sure if it's the best way. But it works. ...

    Not sure if it's the best way. But it works.

    var year = 2014;

    for(var month=0; month<12; month++){
    var lastDay = new Date(y, month+1, 0);
    var lastFriday = new Date(2014, month+1,...
  2. Replies
    6
    Views
    1,249

    It's because getMonth() returns the month from 0...

    It's because getMonth() returns the month from 0 to 11.
  3. Replies
    6
    Views
    1,249

    I'm lost on that one. Wouldn't it be easier to...

    I'm lost on that one. Wouldn't it be easier to use the Date object?


    function valiDate(date, compare){
    compare = new Date(date);
    date = date.split('/');
    return parseInt(date[0]) ==...
  4. Replies
    18
    Views
    1,615

    I messed up as well. The bottom half of the list...

    I messed up as well. The bottom half of the list are indeed opposites of the the top half. The easiest way to get rid of them, is to cut the array in half. This can be done by setting it's length to...
  5. Replies
    18
    Views
    1,615

    Do you need all combinations ( 123 is the same as...

    Do you need all combinations ( 123 is the same as 132, 213, 231, 312 and 321), or all variations (123 is different from 132 ...)?
    Bioniods code gives all variations. The code underneath all...
  6. Replies
    3
    Views
    2,005

    When the src attribute is present on a script...

    When the src attribute is present on a script tag, it ignores the code between the opening and closing tag.
  7. A 'forEach' function normally works on the array...

    A 'forEach' function normally works on the array passed to it. The function you have which returns a new array, is usually called a 'map' function.
    Chapter 6 of http://eloquentjavascript.net/...
  8. Replies
    2
    Views
    804

    Setting the prototype within the constructor...

    Setting the prototype within the constructor function isn't the right way to go, since it will set the prototype everytime an instance is created.
    To avoid execution of the 'level' constructor when...
  9. Replies
    6
    Views
    957

    A variable can be a reference to a function,...

    A variable can be a reference to a function, which can be used to invoke the referred function.


    function heads(){
    document.write("heads");
    };

    var f = heads;
    f()
  10. Replies
    8
    Views
    2,171

    I guess the variable puzzleHolder isn't available...

    I guess the variable puzzleHolder isn't available within the scope of the function checkElement. You're errorconsole should throw an error like 'undefined variable: puzzleHolder'.
  11. Replies
    8
    Views
    2,171

    You can calculate the row number and the value of...

    You can calculate the row number and the value of i_2.
    row number = Math.floor(i/9)
    i_2 = -9+i%9

    I'm wondering why you're loop is running to i<=grid.length, instead of i<grid.length though.

    ...
  12. Replies
    3
    Views
    406

    Yes, add the input boxes and call the function...

    Yes, add the input boxes and call the function calculate_quarter, for the four quarters you need.
    1st argument is an array with the names of the month input boxes for that quarter.
    2nd argument is...
  13. Replies
    3
    Views
    406

    If you're repeating alot of code with different...

    If you're repeating alot of code with different variable, you should try to make functions out of it.


    function SumAverage(){

    function calculate_quarter(months, categories, avgNode,...
  14. Replies
    21
    Views
    724

    It might seem confusing at first, but it helps to...

    It might seem confusing at first, but it helps to recognize those function in debuggers.
  15. Replies
    21
    Views
    724

    The outer (closure) function is self-executing...

    The outer (closure) function is self-executing and returning the inner the inner function. The global isPrime becomes the inner isPrime function.
    The scope of the outer function is preserved and can...
  16. Replies
    21
    Views
    724

    Yes, that's correct

    Yes, that's correct
  17. Replies
    21
    Views
    724

    That console is a little confusing. The...

    That console is a little confusing. The referenced object is an instance of the isPrime constructor. A contructor could be seen as a template to create objects.



    function Person(name){
    ...
  18. Replies
    21
    Views
    724

    Since function declarations are executed before...

    Since function declarations are executed before other statements, the conclusion from above example doesn't seem right to me.
    The javascript interpreter runs it like:


    function isPrime(){var...
  19. IF you need to support older browsers you can do...

    IF you need to support older browsers you can do


    function bind(func, object) {
    return function(){
    return func.apply(object, arguments);
    };
    };

    parag.addEventListener("click",...
  20. Replies
    4
    Views
    973

    When you use document.getElementById on a non...

    When you use document.getElementById on a non existing ID it returns 'null', not 'undefined'.


    if(document.getElementById('testdiv') != null) {
    // exists
    } else {
    // doesn't exist
    }
  21. You should use a 'while' loop instead of a 'do...

    You should use a 'while' loop instead of a 'do while' loop. The 'do while' will execute the code block once, before testing the condition.
  22. When a function is invoked by an event 'this'...

    When a function is invoked by an event 'this' refers to the invoking element, or to the 'window' object depending on the way the function is referred to by the event....
  23. Should look like this: function...

    Should look like this:

    function sumMatrix(matrix){
    var row,
    col,
    rowLength = matrix.length,
    colLength = matrix[0].length,
    rowTotals = new Array(rowLength);
    ...
  24. Replies
    19
    Views
    1,687

    The second loop should be: for(y=0;...

    The second loop should be:

    for(y=0; y<=personarr[x].length; y++)
  25. Replies
    4
    Views
    2,207

    Seems IE is testing the arguments for your...

    Seems IE is testing the arguments for your window.doScroll method, as if they were given to it's own document.documentElement.doScroll method.
    Giving you function a different name should fix your...
Results 1 to 25 of 61
Page 1 of 3 1 2 3
HTML5 Development Center



Recent Articles