simran chandwani

Greenhorn
+ Follow
since Jun 29, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
(keep public parts private until JForum day)
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt
Moderation Tools

Recent posts by simran chandwani

Hello,
I need to take print out of jsp page. I am using window.print() of javascript. It prints page with default header & footer . I need take print outs without header & footer . Can anybody suggest me.

Thanks in adv

Simran Chandwani
This code is working ok. But when I replace int with String throws error.

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
<%

int i=0;
String str=null;
while(i<10)
{i++;
str="abc"+i;
%>

<input type="text" id="aa" onclick="alert(<%=i%>);" />
// <input type="text" id="aa" onclick="alert(<%=str%>);" /> this is not working


<%
}
%>
<script type="text/javascript">

function total(str)
{

alert(str);

}

</script>
</body>
</html>
This code is working ok . But when I replace i with str [for eg alert(<%=str%>)] this shows str is not defined. But this code is working ok with i [integer value]



8 years ago
JSP