Reputation: 13
I made header.jsp and footer.jsp to make dynamic pages. In the accumulated code JavaScript is not running.
<html>
<head>
<title>CAN Invoicing</title>
</head>
<body>
<div style="top:10;height:200px;">
<div style="float:left;">
<a href="/"><img src="/images/Amazon-CAN-Logo.png" alt="CAN INVOICING"></img></a>
</div>
<div style="float:right;top:200px;">
<img src="/images/logo_csmetrics.gif" alt="Powered By CSBI"><img>
</div>
</div>
<div style="top:200px;">
<h1>you are authorized login User ::null</h1>
<script type="text/javascript">
function doTest()
{
alert("hello");
}
</script>
<h2>Session username swasri</h2>
<a href="/test/"target="_blank">test</a>
<a href="/upload/" target="_blank">uplaod</a>
<a href="/uploadS3/" target="_blank">s3</a>
<a href="/readS3/" target="_blank">downloadS3</a>
</div>
<div><p>footer</p></div>
</body>
</html>
The dynamic part starts from <h2>
till footer div. I am using tomcat apache server to run above code. All the jsps are kept inside webapp folder.
I am running above code in tomcat apache webserver.
Upvotes: 0
Views: 120
Reputation: 393
Try calling the doTest() function.
<html>
<title>CAN Invoicing</title>
<head>
<script type="text/javascript">
function doTest()
{
alert("hello");
}
</script>
</head>
<body onload="javascript:doTest();">
<div style="top:10;height:200px;">
<div style="float:left;"><a href="/"><img src="/images/Amazon-CAN-Logo.png" alt="CAN INVOICING"></img></a></div>
<div style="float:right;top:200px;"><img src="/images/logo_csmetrics.gif" alt="Powered By CSBI"><img></div>
</div>
<div style="top:200px;">
<h1>you are authorized login User ::null</h1>
<h2>Session username swasri</h2>
<a href="/test/"target="_blank">test</a>
<a href="/upload/" target="_blank">uplaod</a>
<a href="/uploadS3/" target="_blank">s3</a>
<a href="/readS3/" target="_blank">downloadS3</a>
</div>
<div><p>footer</p></div>
</body>
</html>
Upvotes: 0
Reputation: 2404
Try calling the doTest()
function, right now it isn't being called.
<script type="text/javascript">
function doTest() {
alert("hello");
}
doTest();
</script>
Upvotes: 1