473,382 Members | 1,373 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,382 software developers and data experts.

I need to make dynamic pages with onclick change color

Expand|Select|Wrap|Line Numbers
  1. <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
  2.     pageEncoding="ISO-8859-1"%>
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  4. <html>
  5. <head>
  6. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  7. <meta http-equiv="refresh" content="refreshrate">
  8.  
  9. <title>Insert title here</title>
  10. <link rel="stylesheet" href="C://Users/203243/wal/Number/WebContent/style/stylee.css" type="text/css"></link>
  11. <script type="text/JavaScript">
  12.  
  13. </script>
  14. </head>
  15. <body bgcolor="ffff80" >
  16. <font color="ff0000">
  17. <% 
  18. int[] a={1,2,3,4,5,6,7,8,9,10};
  19.   for(int i : a){
  20.      %> 
  21.      <a href="#" <%out.println(i);%>  >
  22.  
  23.   <% out.println(i);
  24.      if( i<10)
  25.      {
  26.      out.println("|");    
  27.      }
  28.   }
  29.   %>
  30.   </a>
  31.   </font>
  32. </body>
  33. </html>

this is program I need to improvise with onclick on page number it should change color and after I click second page it should refresh previous one and need to change color .pls anyone help
May 5 '10 #1
3 1951
acoder
16,027 Expert Mod 8TB
Where's your JavaScript code?

PS. use CSS for colours/styling.

PPS. please use [code] tags
May 5 '10 #2
@acoder
Thats Why some one edit and make it good ..
I m totally new to java and script . try to edit above code ...
thankx in advance
May 6 '10 #3
acoder
16,027 Expert Mod 8TB
There's no JavaScript code to edit!

Anyway, add an onclick to each link to call a function with the page number passed to the function, e.g. changeCol(1).

In your function, change the colour of the page:
Expand|Select|Wrap|Line Numbers
  1. elem.style.backgroundColor=col;
where elem is the element to change (possible document.body) and col is the colour. Alternatively, use classes by defining them in your CSS code and changing the class instead of setting the background colour directly.
May 6 '10 #4

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

Similar topics

0
by: only_me | last post by:
Not a coding question as such but highly related to asp/dynamic pages issues : has anyone any suggestions on the following ASP sites are generally (always) of a dynamic nature, pages can be...
7
by: Mr B | last post by:
Howdy, I want to set up an Include page in a cell of a table. Then I want to be able to change which page is included on the fly as the user moves the mouse of the various links on the page. ...
10
by: moondaddy | last post by:
I'm writing an ecommerce app in asp.net/vb.net and need to make the pages searchable and crawlable by spiders, particularly Google's. As far as I know, if my pages's contents are mostly populated...
6
by: briand | last post by:
How do I make many pages with the same layout? I have created header, side bar, main body, and footer web controls and added them to a table. I have many pages that want to use this same layout,...
8
by: Sandy Pittendrigh | last post by:
I have a how-to-do-it manual like site, related to fishing. I want to add a new interactive question/comment feature to each instructional page on the site. I want (registered) users to be able...
1
by: thavaht | last post by:
I recently began drawing dynamic pages using PHP + MYSQL. I’m developing the site on windows XP / Apache 1.3.34 / PHP 5.1.2 as a testing server. My publishing server is on another machine on the...
1
by: flashadow | last post by:
Who can explain. Can JsUnit test dynamic pages? A site uses Apache Tomcat for the start. A site consists of starting page in which is loaded 4 jsp pages. Functions that need testing take...
3
by: nma | last post by:
Hi How do I make the cell change color to 'black' after I click on it. The cell will remain black color until I click another cell which will also change to black. I can do the mouseover and...
1
by: =?Utf-8?B?SklNLkgu?= | last post by:
Search engine; Dynamic pages I was reading a few articles that search engines do not support dynamic pages, is there any reference that talks about how we can overcome this issue?
0
by: heiro | last post by:
hi Everyone, Can you please help me on how to convert dynamic pages to statics web pages like in php without affecting your dynamic page? I'm using CGI Python... Thanks
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.