javascript « HTML « JSP-Servlet Q&A

1. javascript in html spacing

<SCRIPT LANGUAGE="JavaScript">  
DynamicImage1(xx) DynamicImage2(yy) DynamicImage3(zz)   
This snippet of JS is in my html. (Each function will display a different value based on the input parameter.) How do I set the ...

2. IE Operation Aborted - None of the regular fixes work!

First of all, I've been researching this "Operation Aborted" error / bug for what seems like weeks, so here are a couple related questions and good articles if you are not ...


I have a JSP page where I load an arraylist which has the list of fields to be displayed.If the arrayList has nothing I will not load any inputbox else create ...

4. How to set the row id [ TR ] and column id [ TD] in displaytag?

I am using Displaytag to display the DataGrid. Now, I have to change the color of rows based on some calculation. Like if the value of column3 + column4 > coulmn5 ...

5. how to get the name of the parent element of the cursor positioned using javascript in html/jsp

I need to get the element name(i.e. text area name where the cursor positioned), and pass the name to the server then when it is back I need to pass thru ...

6. calling a function

I made a database, I am printing my required field in a marquee. Now i want that

if (change>0);
print (image_21);
else print (image_2);
This is the code I am using:
<%@page  import="java.sql.*" %>


7. can we use rowspan and colspan in displaytag?

i have to create a table, whose structure is like this

|col1|col2|      col3       |col4|  
|    ...

8. CSS file is not loading?

I am having a JSP file with the below codes

 <link rel="stylesheet" type="text/css" href="../CSS/home.css" />
 <link rel="stylesheet" type="text/css" href="../CSS/left.css" />
 <script type="text/javascript" src="../js/friend_request.js"></script> 

 <div class="menu">
 <form ...

9. Is there a way to Show/Hide elements without CSS?

I am making one Web UI 508 compliant and one requirement states "working with Web UI when CSS is disabled". We have several places where we show/hide elements using style=display:inline and ...

10. how to make information displayed only in child window?

i hav written code for opening the child window(toolbar is disabled here) thro parent window by( using body onload function) calling the same(login.jsp) page again. wen the parent window (i.e login.jsp) opens ...

11. How to scrape images from a web site with javascript and servlets

I have a web page that has the following content (I've changed the URL in the src tag for privacy purposes, otherwise viewing the page source is identical):


<script type="text/javascript" src="http://localhost/servlet?publicKey=abcdefg12345678&amp"></script>

The resulting ...

12. Dynamically generate Javascript with JSP in IE

I try to do something like that 1.

<head><% out.println("<script type=\"text/javascript\">"); out.println("function myfunction(){"); out.println("for(int i=0;i<10;i++){"); out.println("alert(message+i);"); out.println("}}"); out.println("</script></head>"); %>
and use it like that
<body><input type="button" value="abcd" onclick="myfunction();"/></body>
That is generate javascript within my jsp Pages.And ...

13. Call JSP file with Javascript

I have an HTML file and I want to use javascript to call a JSP file. It doesn't have to be javascript, I'm just looking for the easiest way to ...

14. the way to get a value from a hidden type correctly

in a html table i construct in each row an edit button like the following:

 retour.append("<input type=\"hidden\" id=\"id_"+nomTab+"_"+compteur+"\"  value=\""+object.getIdDailyTimeSheet()+"\"  name=\"hd_"+compteur+"\" />");
this is the hidden type then i do the ...

15. Cancel a rogue jsp comment at the beginning of an html document

I'm working as a front-end developer on an old jsp-based cms that is no longer supported by our vendor. At the beginning of a certain page template, the html document ...

16. HTML Custom Input type for schedule

I'm looking for a way to input a 'schedule' for a task from a user of a web app I'm working on, and have it be used on multiple pages in ...

17. Read window.location.hash servlet-side not possible?

In my web app, a user can click an item in a list, and I modify the url in their browser:


function onListItemClicked() {
    window.location.hash =;
this will change ...

18. Looking for a question that combines the understanding of few web technologies

I am teaching a web development course at a CS department, I wrote most of the final test by now, each question focus on a specific feature or a specific technology, ...

19. I want to get value of one textbox to anoter textbox in html/javascript or jsp/ajex

Hi all I am Trying to to get value of one text box which is entered by me in other non editable text box. like i am enter abc in one text box ...

20. Javascript onload in HTML

I want to ask a question about the javascript "onload". I am writing the JSP page and I use the <%@ include file ="body.jsp". and I use the following statement in ...

21. div open itself in a new window from a jsp?

I have a jsp "template" view in which I am including content from several other jsp's. The content from the other jsp's is being included into a <div> in the ...

22. how not to open new window on clicks after first click on link ,

I need to open a new window on first click on link . But not to open a new windows on clicks on same link after first click. Is there any way to ...

23. Disabling table structure

I have a comprehensive web application with the use of lots of nested tables. This app works fine for desktop version / view. I am in the process of getting it setup for ...

24. Problem while calling a javascript function using jsp

<form name='frm' action="Readcsvv" enctype="multipart/form-data" method="POST" > 
<input type="file" name="file1"><br><br>
<input type="Submit" value="Upload File" onclick="showProgress()" method="POST">

function showProgress() {
    if(document.frm.file1.value == "")
    alert('Please upload ...

25. passing data from javascript to servlet

I have values of checkbox and as soon as I click delete the values and the type must be sent to a servlet called DeleteServlet. Please help me how to send ...

26. Passing input value from parent window to popup window

I had made a parent window that includes a text box and hyperlink to open a PopUp Child JSP Page. I wish to access the value entered in textbox on the ...

27. Call javascript from the parent window

I am very new to javascript as well as jsp... I have a jsp page.In that jsp page i have one text box to enter the url,submit button and Extract button.I also ...

28. Problem with images and JSP

I am not able to see any images in my JSP page. I get the error

Resource interpreted as image but transferred with MIME type text/html.
What does it mean? ...

29. onchange same function multiple times

I have the below function to use in onchange function. Can I use the same function for multiple times in the same form ?

<script type="text/javascript">      

30. Is it possible to assign javascript value to html and use Jsp to get the value?


<form action="javascript.jsp">
   <script type="text/javascript">
   var i = 11;
   var j = 12;
   <input type="hidden" name="test[0]" value=i />
   <input type="hidden" name="test[1]" value=j ...

31. How to use "window.parent.document" between iframes with different domains

I have the JSP "A" and JSP "B", and the JSP "B" is configured as iframe into the JSP "A", but both are in different domains. When I try to ...

32. How to use css with jsp's

I have a site that I built with jsp's and I would like to implement css. I am a noob when it comes to jsp's so any help on how to ...

33. Raphael pie chart, putting dynamic data?

I want to put my dynamic data into the raphael pie chart. I can't write the following code outside window.onload() of my javascript code. Did anyone add dynamic data in the ...

34. Javascript file(s) not loading in view.jsp

In a web page I am developing, I am trying to include two javascript files. the code looks like this:

    <meta http-equiv="pragma" content="no-cache"/>
    <meta http-equiv="expires" ...

35. select option depending on some condition

I have combobox:

<select name="studstatus">
    <option >abiturient</option> 
    <option >bachelor</option> 
    <option ...

36. loosing the data while iterating the table by Rows with Java & JSP

In the jsp page, depending on the number of records, this tr will be executed and displayed to the users.

for(int i=0; i<NoOfRecords.length;i++){
    <td width="15%"> Transit Account & <%= ...

37. Call servlet on in javascript

How can I call servlet using My code is:

onclick='"/PDFServlet", "popupWindowName", 
  "dependent=yes, menubar=no, scrollbars=yes, resizable=1, toolbar=no,width800,height=600")'               ...

38. iframe loading problem in the jsp

<TITLE> Sample CIM Implementation </TITLE>
<script type="text/javascript">
      function init(){

<BODY ...

39. html names don't match

I have this html code:

        <c:forEach items="${config.sources}" var="source" varStatus="sourceStatus">
            <form:checkbox path="sources[${sourceStatus.index}].selected" 

40. How to move a Div over different frames?

I have 3 frames in page. I have a div in the 1st frame and I want it to be displayed at the center of page where 2nd frame is there. ...

41. Call Java Method From Within JavaScript Function?

I've been reading a bit but can't find a simple answer to this. Say I have a HTML page, and some Javascript embeded in that page. Plus I have a java.class ...

42. Script or program for indenting automatically Java and HTML files

I'd like to know if you have some idea for indenting automatically some Java and HTML files. The HTML files could contain JavaScript and JSP code. The ideal program should be executed ...

43. Detecting the visiblity of status bar in internet explorer

I have two frames in my page. The upper frame is a jsp which takes the parameters entered by the user, the lower frame is a Crystal Report viewer which shows ...

44. How to view the image in JSP?

How to view the image file in JSP, which is uploaded in database as blog? Please help me.

45. Printing an iframe from a JSP that is already in an iframe - IE8 problem

My present application has a JSP that prints the contents of a child JSP successfully in all browsers (well, IE6~8, Firefox, Chrome, Safari) using this code:

function printDoc () {

46. Modifying Barelyfitz tabber tab

I am using the following javascript, css tabber tab to create tabbed sections in my jsp. tabber tab As I mentioned in my last question, I want the heading of the ...

47. javascript onclick not working in chrome and IE8 , but works in firefox 7.0.1

I have this javascript.

<script type="text/javascript">
function HandleBrowseClick()
    var fileinput = document.getElementById("userFile");;

<script type="text/javascript">
    function callAddUsers() {

48. how to disable remember password from my site?

Possible Duplicate:
Disable browser 'Save Password' functionality
In my application, I have a login page. Currently in firefox or IE, after giving the credentials and logging ...

49. JSP / Javascript / CSS : auto resize div based on window size

I created a "master page" in jsp using frameset, and I included the master page in my other jsps where i have a in the where the contents will ...

50. How to pass value between parent window and child window

I am using Jsp, Structs. From a parent window (e.g)parent.jsp, I invokes child.jsp, which has a list of checkbox values. I select more than one values, then put it in a ...

51. JavaScript, HTML, JSP onClick statement

Is there a way to use the value from a text field as the parameter value in an onclick statement for a button. For example if you have some text field ...

52. cannot call ActiveXObject method from javascript function in jsp file?

I have a javascript function in a jsp file:

        function browseIt()

53. Passing apostrophe to javascript function

I am not finding a solution on this one using JavaScript (to utilize localStorage) in a JSP. Trying to pass something with apostrophe. I have done a .replaceAll() and replaced the ' ...

54. Iframe visible in IE, not visible in Firefox (3.6)

I have a div

// Se crea un elemento div con una tabla.
var contenedor = document.createElement("div"); = "desplegablePaleta_"+nombreContenedor; = "absolute"; = posicionVertical+'px'; = posicionHorizontal+'px'; = "150px";//"auto"; = "150px";//"auto"; = "auto";"200"; = "white";; ...

55. pass value from javascript to jsp or html??

Hi Dheeraj, Thanks a lot for your reply. Will try that code. Dude I am stuck with another problem can you please help? I want to to connect to mysql database ...

57. pop up window using java script in JSP

Remember that the JSP for the parent window runs on the server in order to create the HTML page to send to the client. Once at the client, and the JavaScript code gets a chance to run, there's no "JSP-ness" there, so no, you can't directly use JSP data. But... in your parent JSP you can create any JavaScript code necessary, ...

59. javascript/css info sent to servlet?

60. Point to an image in a javascript

Hi. This is my javascript function which works in the .html. I need to make ...

61. How to use elements in .css file with javascript in the jsp

I have a jsp in which i need to show some links with the background colour.The links depends on certain conditions which is known.But the requirement is that the background color should be grey and white alternatively. I could have hardcoded the background color with the link. But the problem is that all the links are not visible to all users. ...