473,666 Members | 2,038 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

I need to make dynamic pages with onclick change color

2 New Member
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 1982
acoder
16,027 Recognized Expert Moderator MVP
Where's your JavaScript code?

PS. use CSS for colours/styling.

PPS. please use [code] tags
May 5 '10 #2
prabhuaradhan
2 New Member
@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 Recognized Expert Moderator MVP
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
1479
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 built on the contents of querystrings, so search engines can only be directed to your first index.asp page since the search engine is unable to deduce what querystring parameters should/could be used. I have a company listing site and would like...
7
3175
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. How can I do this? THe include page was set up via FrontPage so it put it's Bot stuff in there, but if someone could tell me the "standard" way to use an include page and if there's a way using onMouseover etc to then change that and refresh it...
10
3222
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 by user controls on a single page and I call these different controls by passing one or more parameters like this: myweb.com/default.aspx?MenuID=44, then the spiders aren't going to be able do to anything with this. asp.net offers lots of great...
6
2247
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, BUT I DON"T to have to duplicate the layout in each page. Is it possible to use the layout from one base class or template? Inheritence only inherits the methods and properties, but not the layout and addition of the web controls. -- Thanks Brian
8
2245
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 to add comments at the bottom of each page, similar to the way the php, mysql, apache manuals work. PUNCHLINE_A:
1
1451
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 same network running Fedora Core 3, Apache 2.0.53 (fedora), PHP 4.3.9. MYSQL Server version is 4.0.27 and it is installed on the Linux machine. I’m using the same mysql for testing and for publishing. The connection to mysql server is successfully...
1
2181
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 information from a page and after processing return data to page using jQuery. And also need testing object which in a constructor has methods which also takes dynamic information from site. The library of jQuery, ajax, JSON is used in a site. Almost all...
3
2709
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 mouseout correctly only to make it change color to black once I click on it. Could someone help? Thansk nma <td width="<?php echo ($cellwidth); ?>" height="17" bgcolor="#00ff00" onMouseOver="this.style.background ='red'"
1
1483
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
1248
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
0
8444
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8869
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8551
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8639
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5664
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1775
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.