New image on every browser refresh

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • design design
    New Member
    • Jun 2011
    • 1

    New image on every browser refresh

    This is suppose to take the images given and every time you refresh the browser page a new image is suppose to appear. The code I have which goes in the ads div.

    code so far:

    Code:
     <div id="ads">
      
          <script type="text/javascript">
    		    
    	var rNumber = randInt(5); 
            var rAd = adDescription(rNumber); 
            var rLink = adLink(rNumber); 
            document.write("<a href=' +rLink +" "+ rAd +"'>");
            document.write(n);
            document.write("</a>") 
    		
          </script>
    1.The problem asks Declare a variable named rNumber equal to the value returned from the randInt() function using 5 as the parameter value.
    2. Declare a variable named rAd equal to the text string returned from the adDescription() function using rNumber as the parameter value.
    3. Declare a vaiable named rLink equal to the URL returned from the adLink() function using rNumber as the parameter value.
    4. Insert a command to write the text
    <a href="url">
    <img src="adn.jpg" alt="descriptio n"/></a>

    All the files shown above are the attached js for the document.
    Last edited by Dormilich; Jun 14 '11, 08:57 AM. Reason: please use [CODE] [/CODE] tags when posting code
Working...