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
    2
    Views
    366

    Other You can't have an if statement inside a object...

    You can't have an if statement inside a object declaration. You could something like

    for (var city in citymap) {
    var cityCircle = new google.maps.Circle({
    strokeColor: '#FF0000',
    ...
  2. Because the regex tells it the match can't have...

    Because the regex tells it the match can't have another " after img src=". If it would stop at the last ", the match would have more " in it.

    <img src="/sites/ContentCenter/Graphics/map-al.jpg"...
  3. Other Does this work correct? function compare(a, b) {...

    Does this work correct?
    function compare(a, b) {
    a = a.split('@')[1];
    b = b.split('@')[1];
    var factors = ['domx.com', 'domy.com', 'domz.com'];
    return factors.indexOf(a) - factors.indexOf(b);...
  4. Replies
    3
    Views
    782

    Sorry, my explanation was a little to short. ...

    Sorry, my explanation was a little to short.

    Boundaries are at the start of a string (when the string start with a word character) or end of a string (when the string ends with a word character)...
  5. Replies
    3
    Views
    782

    Boundaries are at the start of a string, end of a...

    Boundaries are at the start of a string, end of a string and between each word and non-word character.
    '\bhello\b ! \bh\b'
  6. Replies
    16
    Views
    1,667

    The HTML also needs a correction. ...

    The HTML also needs a correction.

    <table><id="table"div style=
  7. If you don't want to show a message when the...

    If you don't want to show a message when the input is empty you should do the following.

    if (emailVal) { //if the error message div is already on the page
    ...
  8. There is no reference to parent object of a...

    There is no reference to parent object of a property. Therfor the same goes for a child object unless you specify a reference on to the parent on the child object yourself.

    For achieving...
  9. Replies
    4
    Views
    1,015

    When you call makeAdder, it returns a...

    When you call makeAdder, it returns a function(y){...} with a parent scope from the parent function (makeAdder) with holds the value of x.



    var z = 0;

    function makeAdder(x) {
    return...
  10. Thread: bulls and cows

    by Kever
    Replies
    15
    Views
    1,770

    function splitInt(int) { var ret; ret[0] =...

    function splitInt(int) {
    var ret;
    ret[0] = (int - (int % 1000)) / 1000;
    ret[1] = ((int - four * 1000) - ((int - four * 1000) % 100)) / 100;
    ret[2] = ((int - (four * 1000) - (three * 100))...
  11. Thread: bulls and cows

    by Kever
    Replies
    15
    Views
    1,770

    playerFourDigit = (b - (b % 1000)) / 1000;...

    playerFourDigit = (b - (b % 1000)) / 1000;
    playerThreeDigit = ((b - playerFourDigit * 1000) - ((b - playerFourDigit * 1000) % 100)) / 100;
    playerTwoDigit = ((b - (playerFourDigit * 1000) -...
  12. Thread: bulls and cows

    by Kever
    Replies
    15
    Views
    1,770

    There are a lot of ways to split the variable...

    There are a lot of ways to split the variable guess into four separate variables. The function computer basically does the same thing.
  13. Thread: bulls and cows

    by Kever
    Replies
    15
    Views
    1,770

    var guess = prompt("Please enter a 4 digits...

    var guess = prompt("Please enter a 4 digits number");
    if (a == b || a == c || a == d || b == c || b == d || c == d) {
    Between those lines you'll need to parse guess into a, b, c and d.
  14. Replies
    10
    Views
    1,693

    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
    ...
  15. Replies
    2
    Views
    787

    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...
  16. Replies
    9
    Views
    2,534

    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...
  17. Replies
    3
    Views
    1,788

    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...
  18. Replies
    9
    Views
    2,534

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

    It's javascript. I put it between [php] tags for the highlighting.
  19. Replies
    9
    Views
    2,534

    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;
    ...
  20. 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...
  21. Replies
    1
    Views
    947

    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();
    ...
  22. Replies
    5
    Views
    1,649

    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...
  23. Replies
    9
    Views
    2,677

    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....
  24. Replies
    3
    Views
    1,609

    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...
  25. Replies
    3
    Views
    1,243

    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 + '_'...
Results 1 to 25 of 90
Page 1 of 4 1 2 3 4
HTML5 Development Center



Recent Articles