www.webdeveloper.com

Search:

Type: Posts; User: mjy

Search: Search took 0.01 seconds.

  1. Thread: delete html block

    by mjy
    Replies
    2
    Views
    865

    The following is a simple prototype that does...

    The following is a simple prototype that does what I think you want. And yes, the IDs have to be unique:


    <!DOCTYPE html>
    <html>
    <head>
    <title>JavaScript Tester Page</title>

    <script>...
  2. Replies
    5
    Views
    8,089

    To get closeWindow() to work on IE as well as FF,...

    To get closeWindow() to work on IE as well as FF, you can check whether the global object 'netscape' has been defined before referencing it (to avoid a runtime error). The function does work in FF8,...
  3. Replies
    4
    Views
    3,845

    The JSON object is part of ECMAScript 5. For the...

    The JSON object is part of ECMAScript 5. For the sake of older browsers, you might want to test whether this object is present, and if it isn't use the public-domain json2.js module available at...
  4. Thread: Infinity problem

    by mjy
    Replies
    2
    Views
    704

    Hello shwetab, The problem is that in...

    Hello shwetab,

    The problem is that in JavaScript (unlike C or Java), just because the operands of the / operator are both integers, doesn't mean that the value returned will be an integer. Rather,...
  5. Replies
    4
    Views
    3,845

    I believe that when you assign testObj to the...

    I believe that when you assign testObj to the value property of the <input> control


    $('#tbtestbox').val(testObj );

    the object is converted to text by an implicit call to its toText() method....
  6. Thread: onclick problem

    by mjy
    Replies
    1
    Views
    537

    When a JavaScript URL returns a value, the...

    When a JavaScript URL returns a value, the browser displays that value. You need to add the 'void' operator so that the expression is evaluated for its side effect, but only 'undefined' is returned,...
  7. Replies
    2
    Views
    530

    By default, a cookie is accessible to the web...

    By default, a cookie is accessible to the web page that created it and any other web page in the same directory, or in a subdirectory of that directory. To make a cookie visible to any web page in...
  8. Replies
    5
    Views
    3,433

    I guess I was assuming that leoghost's script...

    I guess I was assuming that leoghost's script could be rewritten to use a global function rather than element methods. Sadly, we can't just add a getElementsByClassName() implementation to...
  9. Replies
    5
    Views
    3,433

    xelawho's solution looks good. Additionally, if...

    xelawho's solution looks good. Additionally, if you want to prevent overwriting an already existing document.getElementsByClassName() method, you could do something like:

    ...
  10. Replies
    14
    Views
    22,571

    Just put it in a element in the HEAD....

    Just put it in a <script> element in the HEAD. BTW, an alternative way to preload an image that you'll see a lot is to use the Image() constructor, so the following two lines of JavaScript are...
  11. Replies
    14
    Views
    22,571

    The "var img; ... window.onload..." code is where...

    The "var img; ... window.onload..." code is where the global variable 'img' gets declared and initialized. You can see 'img' used later in the 'onmouseover' and 'onmouseout' code.

    I got in the...
  12. Thread: Preload a PDF

    by mjy
    Replies
    1
    Views
    1,238

    Maybe assigning the PDF file to an image node's...

    Maybe assigning the PDF file to an image node's src property doesn't load and cache the file because it's in PDF format, not a standard graphics format like JPG, GIF, or PNG. I'm curious how you are...
  13. Replies
    14
    Views
    22,571

    Don't forget to preload the images. Once you've...

    Don't forget to preload the images. Once you've shown the images in your own browser, they'll be cached and will display fast, so it's easy to forget that the first time other users hover over a link...
  14. Replies
    14
    Views
    22,571

    Hi Mikethepainter, Looks like you're getting...

    Hi Mikethepainter,
    Looks like you're getting there! Just a few comments. First, you seem to have some extraneous code, such as the duplicated image (same ID and everything -- just delete one of...
  15. Replies
    14
    Views
    22,571

    Here's a complete page that does something like...

    Here's a complete page that does something like you want, I think:


    <!DOCTYPE html>
    <html>
    <head>
    <title>Test Page</title>

    <script>
Results 1 to 15 of 15
HTML5 Development Center



Recent Articles