Jump to content

davej

Moderator
  • Posts

    3,988
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by davej

  1. Actually i think after writing a code for image file you have to upload it in a tools like dream viewer or something in that, according to your theme there is a path to upload your images in that path you have to upload your images..

    No, he's taking about using local files on his own computer.

     

    If you create a folder on your desktop and you put the image file and the html file in that same folder then it should find the image.

     

    If you want to actually use IIS then you can't put the folder on your desktop. You will need to find and use your inetpub\wwwroot folder.

  2. No, the control panel is how you will access your web-hosting service.

     

    Before choosing a web-hosting service you can look for web-hosting reviews such as...

     

    http://www.pcmag.com/article2/0%2c2817%2c2427219%2c00.asp

     

    You can practice building your website on your desktop using a simple text editor

    such as Notepad or Wordpad or download a free text editor such as...

     

    https://notepad-plus-plus.org/

  3. Actually w3schools.in is unaffiliated with w3schools.com (at least AFAIK)

     

    The question you are asking is related to polymorphism.

     

    A subclass can be declared as a superclass, as in the following...

    Bicycle bike01 = new Bicycle(20, 10, 1);
    Bicycle bike02 = new MountainBike(20, 10, 5, "Dual");
    Bicycle bike03 = new RoadBike(40, 20, 8, 23);
    

    Assuming the MountainBike and RoadBike classes both extend (inherit) the Bicycle class.

     

    See...

     

    https://docs.oracle.com/javase/tutorial/java/IandI/polymorphism.html

  4. Having NULL type as an object to be a bug in js, is there any harm to code this could result in, and what precautions should we take to avoid such harm?

     

    Null is commonly used to indicate that a variable or object is invalid, so it is not a bug, but it may indeed indicate that your code isn't working.

  5. If that was lesson 1 then lesson 2 should be to avoid using document.write(). Instead learn to use innerHTML.

    <!DOCTYPE html>
    <head>
    <meta charset="utf-8">
    <title>title</title>
    </head>
    <body>
    
    hello all
    <div id="div1">
    </div>
    
    <script>
       var str = '';
       var ele = document.getElementById('div1');
       str += (5+7);
       str += (4);
       ele.innerHTML = str;
    </script>
    </body>
    </html>
    
  6. Suppose I have a basic table 2x2 that I draw using JavaScript. Furthermore, I use a function because the table will be a bit dynamic, with input parameters. One of the cells contains "X", others are empty.

    [...]

    I want the following to happen: when I click on a cell, I want the WHOLE table to reload itself, but with the "X" in the cell that I clicked on.

     

    I have some difficulty understanding what you are really asking for.

     

    Do you merely want to move the "X" around inside the table? Or are you expanding the number of table-cells with each click?

     

    If you are merely moving the "X" around then there is no reason to re-create the table.

     

    And why must this involve recursion?

  7. You have this...

    <div class="controls">
     <fieldset id="jform_profile_tos" class="required radio" required aria-required="true">
      <input type="radio" id="jform_profile_tos0" name="jform[profile][tos]" value="1" required aria-required="true" />
      <label for="jform_profile_tos0">Agree</label>
      <input type="radio" id="jform_profile_tos1" name="jform[profile][tos]" value="0" checked="checked" required aria-required="true" />
      <label for="jform_profile_tos1" >No</label>
     </fieldset>
    </div>
    

    ...what happens if you replace it with...

    <div class="controls">
    <input type="checkbox" id="jform_profile_tos0" name="jform[profile][tos]" value="1"/>
    <label for="jform_profile_tos0">I Agree</label>
    </div>
    
  8. It seems that you are complaining that Math.random() is not truly random. I'm sure it isn't. The distribution does look fairly flat... The flatness can be examined with a simple test program...

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="utf-8">
    <title>Math.Random()</title>
    </head>
    
    <body>
    <p>Math.random</p>
    <div id="out"></div>
    
    <script>
    'use strict';
        var a = [];
        for (var i=0 ; i<100 ; i++){
           a[i] = 0;
        }
        for (var i=0 ; i<1000000 ; i++){
           var x = Math.random();
           var n = Math.floor(x*100.0);
           //alert(n);
           a[n]++;
        }
        var str = "";
        for (var i=0 ; i<100 ; i++){
           str += i + " : " + a[i] + "<br/>";
        }
        document.getElementById("out").innerHTML = str;
    
    </script>
    
    </body>
    </html>
    

    However it certainly is NOT considered random enough for cryptography.

     

    https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random

    • Like 1
×
×
  • Create New...