Javascript Random Image Tutorial




This is a basic javascript code for showing a random image in browser , you cand show any type of image and as many as you wish

Original source


21 responses to “Javascript Random Image Tutorial”

  1. @MrJustTryin

    Well .. in this case we have a if statement witch basically says if variable rnd value equals to 0 then set variable rnd value to 1. If you say rnd = 0 in any programming language that means that variable rnd value equals to 0 (like you are setting up that value) but if you say rnd == 0 you check to see if variable rnd is equal to 0 .

    Thanks for viewing my videos !

  2. @huasentertainment well .. javascript is a client side scripting language so it cannot read the content of a directory you will have to do that with some other language ex php witch is server side and populate the array then let javascript do its job , have fun !

Leave a Reply