dcsimg
www.webdeveloper.com

Search:

Type: Posts; User: Kever

Page 1 of 4 1 2 3 4

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    706

    There's something wrong with the calculation of...

    There's something wrong with the calculation of the last day of the month.

    lastDate = new Date(String(monthNum+1)+"/0/"+String(yearNum)); // invalid date
    numbDays = lastDate.getDate(); // NaN
    ...
  2. Replies
    2
    Views
    340

    You're not declaring 'i' locally, so it uses the...

    You're not declaring 'i' locally, so it uses the same variable 'i' as your global loop.

    function appendToOutput(toAppend){
    output.innerHTML = output.innerHTML + toAppend;
    }

    function...
  3. Replies
    9
    Views
    1,958

    You should add you're methods to the prototype...

    You should add you're methods to the prototype like you do with the 'update' method.
    Also you should pay more attention to you're opening and closing braces, maybe you should try an editor with...
  4. Replies
    3
    Views
    1,124

    The way you're determining dates by adding...

    The way you're determining dates by adding miliseconds is quite error prone. It's better to use the date methods. I rewrote most of the date calculation code, not sure how to handle vehicles bought...
  5. Replies
    9
    Views
    1,958

    It's javascript. I put it between [php] tags for...

    It's javascript. I put it between [php] tags for the highlighting.
  6. Replies
    9
    Views
    1,958

    There are a lot of logical and syntax errors. ...

    There are a lot of logical and syntax errors.


    function PlayerConst(userName, score, highScore) {
    this.username = userName;
    this.score = score;
    this.highScore = highScore;
    ...
  7. function focus(){ ...

    function focus(){
    if(form.username.value=="Please enter your username" && form.username.type="text"){form.username.value=""} // assignment instead of a comparison
    if(form.username.value=="Please...
  8. Replies
    1
    Views
    711

    AJAX I don't know which tutorial you refer to, but the...

    I don't know which tutorial you refer to, but the URL shouldn't be inside the callback function. It should look like:

    function loadDoc(url, type, cFunc) {
    var xhttp = new XMLHttpRequest();
    ...
  9. Replies
    5
    Views
    1,285

    Solved some problems.

    Solved some problems.

    <div style = "display:show" id="part"> // display 'show' is not valid

    setTimeout(raceScreen(), 2000); // calling raceScreen immediately and setting using it's return...
  10. Replies
    9
    Views
    2,284

    When you're printing out the date a string value...

    When you're printing out the date a string value is expected, so the toString() method is invoked. When you're doing an operation where a primitive value is expected, the valueOf() method is invoked....
  11. Replies
    3
    Views
    1,413

    Other var Tablica = new Array(); for(i=0 ; i

    var Tablica = new Array();

    for(i=0 ; i<5 ; i++) {
    Array[i] = prompt("Write numbers and letters: "); // error here
    }
    /*
    function check(a, b) {
    return a-b // this only works for numbers...
  12. Replies
    3
    Views
    963

    var nums = ['one', 'two', 'three', ...]; //...

    var nums = ['one', 'two', 'three', ...]; // You'll get the idea

    nums.forEach(function(value, index) {
    $('a[title="Product ' + value + '"]').hide();

    $('input[value="Product ' + value + '_'...
  13. Replies
    2
    Views
    880

    document.getElementById("text").innerHTML = i +"...

    document.getElementById("text").innerHTML = i +" = "+ person[i];
  14. Replies
    4
    Views
    1,265

    countdown(..., ...) is just a function call with...

    countdown(..., ...) is just a function call with two arguments. The 5 for parameter sec and a callback function for parameter onTick.
  15. Replies
    3
    Views
    1,062

    You can call a function with a given 'this'...

    You can call a function with a given 'this' keyword by using the 'call' method on a function. Using the bind method, you can create a new function with a given 'this' and given arguments.

    function...
  16. Replies
    9
    Views
    1,819

    Other You can calculate the position using the modulus....

    You can calculate the position using the modulus.

    var days_letters = new Array ("H", "J", "A", "O", "D", "B", "Z");
    var months_letter = new Array ("Z", "B", "J", "H", "O", "A", "B", "D", "H",...
  17. 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,...
  18. Replies
    6
    Views
    2,221

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

    It's because getMonth() returns the month from 0 to 11.
  19. Replies
    6
    Views
    2,221

    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]) ==...
  20. Replies
    18
    Views
    2,785

    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...
  21. Replies
    18
    Views
    2,785

    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...
  22. Replies
    3
    Views
    2,316

    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.
  23. 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/...
  24. Replies
    2
    Views
    1,036

    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...
  25. Replies
    6
    Views
    1,229

    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()
Results 1 to 25 of 77
Page 1 of 4 1 2 3 4
HTML5 Development Center



Recent Articles