Edward
I see you have also posted this to the p2p site
The smartest way to do this is to setup pahe language="java"
then script language="javascript" later on
If this doesnt work we will have to view all the source (including the 3 JSP
includes)
-Martin
Example:
<[EMAIL PROTECTED] language="java" contentType="text/html"%>
<html>
<head>
<%
// JSP-Variable definieren und Text zuweisen
String strText = "Some Text";
%>
<script language="javascript">
<!-- JavaScript Code fuer Browser, die kein Scripting
unterstuetzen ausblenden
// JSP-Variable der JavaScript-Variablen zuweisen
var jsText = "<%=strText%>";
// JavaScript Funktion zum Anzeigen des Textes
function showText()
{
alert("Text: " + jsText);
}
// Ende der JavaScript Sektion -->
</script>
/head>
<body onload = "showText()">
</body>
</html>
----- Original Message -----
From: "Edward King" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, February 18, 2003 11:29 PM
Subject: errors In run my jsp
> I have a question ,this question puzzled me for a long time. I put a
Javascript in my JSP file.But this Javascript raise errors.My structure is a
bit complicated. I have a jsp file named total.jsp,it includes three JSP
file. one JSP file "body.jsp" contains JavaScript.My purpose is to run
total.jsp first,and from total.jsp,I run body.jsp,so I can run my JavaScript
in it.But when I run it,it raise errors:
> line:10
> error:document.newUserForm is not object
>
> Why raise this error? Please help me.My files are follows:
>
>
> total.jsp
> -----------
> | title.jsp |
> | body.jsp |
> | foot.jsp |
> -----------
>
> /*total.jsp*/
> <html>
> <head>
> <title>total</title>
> </head>
> <body>
> <%@ include file="title.jsp" %>
> <%@ include file="body.jsp" %>
> <%@ include file="foot.jsp" %>
> </body>
> </html>
>
> /*title.jsp*/
> <p>This is title jsp</p>
>
> /*foot.jsp*/
> <p>This is foot jsp</p>
>
> /*foot.jsp*/
> <%@ page contentType="text/html" %>
> <script language="JavaScript">
> function trans()
> {
> document.newUserForm.submit();
> }
> </script>
> <body>
> <form method="post" action="addUser.jsp" name="newUserForm">
> <p>
> <input type="button" name="Submit" onclick="trans()">
> </form>
>
> Thanks in advance
>
>
===========================================================================
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
>
> Some relevant archives, FAQs and Forums on JSPs can be found at:
>
> http://java.sun.com/products/jsp
> http://archives.java.sun.com/jsp-interest.html
> http://forums.java.sun.com
> http://www.jspinsider.com
>
===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant archives, FAQs and Forums on JSPs can be found at:
http://java.sun.com/products/jsp
http://archives.java.sun.com/jsp-interest.html
http://forums.java.sun.com
http://www.jspinsider.com