www.webdeveloper.com

Search:

Type: Posts; User: mrhoo

Page 1 of 20 1 2 3 4

Search: Search took 0.06 seconds.

  1. Replies
    1
    Views
    340

    Other 'This is a day' is only used once in your...

    'This is a day' is only used once in your example.

    It is unclear how you are measuring density- 2 is 8 and a third percent of 24, but the density should take into account the size of your keyword,...
  2. Replies
    4
    Views
    6,755

    You can use the comma insertion method here, but...

    You can use the comma insertion method here, but it is annoying to insert things while the user is typing.

    Better to use it once- onchange, or just before submitting, whenever you validate the...
  3. Where does str come from in your code, and why...

    Where does str come from in your code, and why are you splitting it on a space instead of 'x' or ' x '?
  4. Replies
    1
    Views
    862

    You are finding 4 digits, as requested by your...

    You are finding 4 digits, as requested by your pattern.

    If you want to restrict the match to strings that only contain 2-4 digits and nothing else, flag the beginning and end of the string-

    ...
  5. // I prefer to let the machine do the work- ...

    // I prefer to let the machine do the work-



    function dowFromDmy(input){
    var M= input.value.match(/(\d+)/g);
    if(M){
    return 'Sun,Mon,Tues,Wednes,Thurs,Fri,Sat'.split(',')[
    ...
  6. Replies
    4
    Views
    1,541

    You have around 30000 characters, if you type an...

    You have around 30000 characters, if you type an average 40wpm you could do it in about 3 hours.

    Knowing what to type, and possibly testing it as you write, takes longer.
  7. Replies
    2
    Views
    2,001

    You'd be better off comparing top.location.href...

    You'd be better off comparing top.location.href and location.href, since some browsers have a separate location object for top and child location objects, even it they have the same href. Two objects...
  8. Replies
    1
    Views
    1,319

    Prototype excuse it- I neglected to see your assigning via...

    excuse it- I neglected to see your assigning via innerHTML, which doesn't work for table cells in older IE's.
  9. Use strings instead of numbers- you can...

    Use strings instead of numbers- you can alert(number.toString(8))

    to return 106341417 in most browsers, but it is an error in strict code,

    and no number except 0 in any base begins with a zero-...
  10. Replies
    1
    Views
    3,238

    Forget the local offset, it has no relevance to...

    Forget the local offset, it has no relevance to other timezones.

    Use UTC time methods- for each timezone, add the offset (positive or negative) to the UTC time, then read the UTC properties, and...
  11. You can replace the operators with themselves...

    You can replace the operators with themselves followed by a newline.


    function calc(strIn){
    strIn= strIn.replace(/[^\.\d*\/+-]+/g, '');
    var tarrN= strIn.replace(/([\D\.]+)/g, '$1\n')+...
  12. Most browsers implement the Array method...

    Most browsers implement the Array method .indexOf(what, i),
    which returns the first index at which its value is found(starting at i, or 0 if not specified).
    If the value is not found in the array,...
  13. I meant to edit the previous post but waited too...

    I meant to edit the previous post but waited too long- this is a simpler version of the same script-

    <!doctype html>
    <html lang="en">
    <head>
    <meta charset= "utf-8">
    <title>nth days</title>
    ...
  14. <!doctype html>
    <html lang="en">
    <head>
    <meta charset= "utf-8">
    <title>nth days</title>

    </head>
    <body>
    <ul>
    <script>
  15. Replies
    2
    Views
    161

    var s='abcd2DPM_0361.DSS|1588224:...

    var s='abcd2DPM_0361.DSS|1588224: abcdinterv120808wc.doc|28672: abcdDPM_0360.DSS|563712: abcd3_0365.DSS|1565184: Abcd_Last-GK.DSS|771072:';

    s.replace(/\|[^:]*\:/g,' '); //replace pipe followed by...
  16. Thread: generator txt

    by mrhoo
    Replies
    2
    Views
    114

    google combinations and permutations.

    google combinations and permutations.
  17. // Pass the empty string function...

    // Pass the empty string

    function highlightControl(ctl, mode){
    document.getElementById(ctl).style.borderColor= mode== 'on'? 'red':'';
    }
  18. Replies
    4
    Views
    439

    I find that burying it in the garden works well.

    I find that burying it in the garden works well.
  19. When you use number.toFixed() with no argument...

    When you use number.toFixed() with no argument you convert number to an integer with no decimal.
    number.toFixed(10) may be what you need.

    If you want to include trailing zeroes for numbers with...
  20. You are subtracting item.x while you are defining...

    You are subtracting item.x while you are defining it- nothing to do with regular expressions.


    var itm={canvas:{width:100},sprite_width:50};
    itm.x = itm.canvas.width / 2 - itm.sprite_width / 2...
  21. Thread: Military Code

    by mrhoo
    Replies
    11
    Views
    2,764

    This is another approach. ...

    This is another approach.


    <!doctype html>
    <html lang="en">
    <head>
    <meta charset= "utf-8">
    <title>Military Jargon</title>
    <style>
    body{font-size:125%;margin:1em;}
  22. Replies
    11
    Views
    1,362

    slice will return a (shallow) copy of the indexed...

    slice will return a (shallow) copy of the indexed array items, not any custom properties you have added.
  23. Thread: div.onresize

    by mrhoo
    Replies
    1
    Views
    1,864

    https://developer.mozilla.org/en/DOM/element.onres...

    https://developer.mozilla.org/en/DOM/element.onresize

    According to MDN, only the window has a resize event.
  24. Replies
    11
    Views
    1,362

    That's called a shallow clone, and makes copies...

    That's called a shallow clone, and makes copies of arrays of primitives- (strings, numbers, booleans, undefined).

    If you are cloning an object with properties that are objects, (including arrays)...
  25. Replies
    11
    Views
    1,362

    You have an array with two indexed elements and...

    You have an array with two indexed elements and four named properties.
    It is as much code to clone it as to write a new one.


    var NAMEDONS= ["George", "Elisabeth"];
    NAMEDONS["George "]=...
Results 1 to 25 of 500
Page 1 of 20 1 2 3 4
HTML5 Development Center



Recent Articles