By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,442 Members | 1,332 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,442 IT Pros & Developers. It's quick & easy.

New image on every browser refresh

P: 1
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:

Expand|Select|Wrap|Line Numbers
  1.  <div id="ads">
  3.       <script type="text/javascript">
  5.     var rNumber = randInt(5); 
  6.         var rAd = adDescription(rNumber); 
  7.         var rLink = adLink(rNumber); 
  8.         document.write("<a href=' +rLink +" "+ rAd +"'>");
  9.         document.write(n);
  10.         document.write("</a>") 
  12.       </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="description"/></a>

All the files shown above are the attached js for the document.
Jun 11 '11 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.