Help With HTML

R

Ryan

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
<!-- //
function WhoAmI(){
return John Doe;
}
// -->
</script>
</head>
<body>
<table>
<tr>
<td><% WhoAmI %></td>
</tr>
</table>
</body>
</html>
 
K

Karl E. Peterson

Ryan said:
<script language="javascript">
<!-- //
function WhoAmI(){
return John Doe;
}
// -->
</script>

Shouldn't that be:

return 'Admiral Stockdale';

? <bg>

More seriously, did you have an actual question?
 
R

Ronx

I assume your unasked question is:
"Why doesn't the script work?"

You are mixing asp with JavaScript.

Rewrite as:

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
<!-- //
function WhoAmI(){
return "John Doe";
}
// -->
</script>
</head>
<body>
<table>
<tr>
<td><script type="text/javascript">
document.write(WhoAmI());
</script>
</td>
</tr>
</table>
</body>
</html>

Also note the quotes around John Doe.
--
Ron Symonds
Microsoft MVP (Expression)
http://www.rxs-enterprises.org/fp

Reply only to group - emails will be deleted unread.
 
T

Tom [Pepper] Willett

But you didn't tell us what type of help you need.

--
Tom [Pepper] Willett
Microsoft MVP - FrontPage
---------------------------
: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
: <html>
: <head>
: <title></title>
: <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
: <meta name="vs_targetSchema"
: content="http://schemas.microsoft.com/intellisense/ie5">
: <script language="javascript">
: <!-- //
: function WhoAmI(){
: return John Doe;
: }
: // -->
: </script>
: </head>
: <body>
: <table>
: <tr>
: <td><% WhoAmI %></td>
: </tr>
: </table>
: </body>
: </html>
 
R

Ryan

The following code won't print any thing; I need it to print John Doe.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
<!-- //
function WhoAmI(){
return "John Doe";
}
// -->
</script>
</head>
<body>
<table>
<tr>
<td>
<script type="text/javascript"> document.write(WhoAmI());
</script>
</td>
</tr>
</table>
</body>
</html>
 
R

Ryan

Thanks Ronx; that was really my question but I forgot to type that in.
Any ways, I have used your code but it still won't print John Doe

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
<!-- //
function WhoAmI()
{
return "John Doe";
}
// -->
</script>
</head>
<body>
<table class = "closed" ID="Table1">
<tr>
<td>Name:<script type="text/javascript"> document.write(WhoAmI());
</script> </td>
</tr>
</table>
</body>
</html>
 
K

Karl E. Peterson

Ryan said:
The following code won't print any thing; I need it to print John Doe.

Hmmmmm, "works here." How are you testing it?

All I did was pop open FrontPage, paste the code below into "new_page_1.htm" and hit
the Preview tab. Worked fine.
--
..NET: It's About Trust!
http://vfred.mvps.org


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
<!-- //
function WhoAmI(){
return "John Doe";
}
// -->
</script>
</head>
<body>
<table>
<tr>
<td>
<script type="text/javascript"> document.write(WhoAmI());
</script>
</td>
</tr>
</table>
</body>
</html>





Tom [Pepper] Willett said:
But you didn't tell us what type of help you need.

--
Tom [Pepper] Willett
Microsoft MVP - FrontPage
---------------------------
: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
: <html>
: <head>
: <title></title>
: <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
: <meta name="vs_targetSchema"
: content="http://schemas.microsoft.com/intellisense/ie5">
: <script language="javascript">
: <!-- //
: function WhoAmI(){
: return John Doe;
: }
: // -->
: </script>
: </head>
: <body>
: <table>
: <tr>
: <td><% WhoAmI %></td>
: </tr>
: </table>
: </body>
: </html>
 
R

Ryan

It works fine on the server but won't run on local machine.

Karl E. Peterson said:
Ryan said:
The following code won't print any thing; I need it to print John Doe.

Hmmmmm, "works here." How are you testing it?

All I did was pop open FrontPage, paste the code below into "new_page_1.htm" and hit
the Preview tab. Worked fine.
--
..NET: It's About Trust!
http://vfred.mvps.org


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
<!-- //
function WhoAmI(){
return "John Doe";
}
// -->
</script>
</head>
<body>
<table>
<tr>
<td>
<script type="text/javascript"> document.write(WhoAmI());
</script>
</td>
</tr>
</table>
</body>
</html>





Tom [Pepper] Willett said:
But you didn't tell us what type of help you need.

--
Tom [Pepper] Willett
Microsoft MVP - FrontPage
---------------------------
: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
: <html>
: <head>
: <title></title>
: <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
: <meta name="vs_targetSchema"
: content="http://schemas.microsoft.com/intellisense/ie5">
: <script language="javascript">
: <!-- //
: function WhoAmI(){
: return John Doe;
: }
: // -->
: </script>
: </head>
: <body>
: <table>
: <tr>
: <td><% WhoAmI %></td>
: </tr>
: </table>
: </body>
: </html>
 
K

Karl E. Peterson

Ryan said:
It works fine on the server but won't run on local machine.

Okay, "dumb question" time, do you have JavaScript disabled for that machine?

If it's working on one machine, it'll work on any machine that JavaScript works on.
Especially if you're testing in the same browser.
 
R

Ronx

Try it in FireFox.
IE will block JavaScript running from a file on your PC. It will run from a
server.

To bring the script up to date,
Change
<script language="javascript">
to
<script type="text\javascript">

and change
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
to
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">

(if you use a !doctype, use a one that is complete)
--
Ron Symonds
Microsoft MVP (Expression)
http://www.rxs-enterprises.org/fp

Reply only to group - emails will be deleted unread.



Ryan said:
It works fine on the server but won't run on local machine.

Karl E. Peterson said:
Ryan said:
The following code won't print any thing; I need it to print John Doe.

Hmmmmm, "works here." How are you testing it?

All I did was pop open FrontPage, paste the code below into
"new_page_1.htm" and hit
the Preview tab. Worked fine.
--
..NET: It's About Trust!
http://vfred.mvps.org


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
<!-- //
function WhoAmI(){
return "John Doe";
}
// -->
</script>
</head>
<body>
<table>
<tr>
<td>
<script type="text/javascript">
document.write(WhoAmI());
</script>
</td>
</tr>
</table>
</body>
</html>





:

But you didn't tell us what type of help you need.

--
Tom [Pepper] Willett
Microsoft MVP - FrontPage
---------------------------
: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
: <html>
: <head>
: <title></title>
: <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
: <meta name="vs_targetSchema"
: content="http://schemas.microsoft.com/intellisense/ie5">
: <script language="javascript">
: <!-- //
: function WhoAmI(){
: return John Doe;
: }
: // -->
: </script>
: </head>
: <body>
: <table>
: <tr>
: <td><% WhoAmI %></td>
: </tr>
: </table>
: </body>
: </html>
 
M

Mike Mueller

You will need to adjust your settings in IE
Tools >Internet Options > Advanced
---- scroll down to Security
-Allow active content to run in files on My Computer (check it)
-- restart IE

Ryan said:
It works fine on the server but won't run on local machine.

Karl E. Peterson said:
Ryan said:
The following code won't print any thing; I need it to print John Doe.

Hmmmmm, "works here." How are you testing it?

All I did was pop open FrontPage, paste the code below into
"new_page_1.htm" and hit
the Preview tab. Worked fine.
--
..NET: It's About Trust!
http://vfred.mvps.org


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
<meta name="vs_targetSchema"
content="http://schemas.microsoft.com/intellisense/ie5">
<script language="javascript">
<!-- //
function WhoAmI(){
return "John Doe";
}
// -->
</script>
</head>
<body>
<table>
<tr>
<td>
<script type="text/javascript">
document.write(WhoAmI());
</script>
</td>
</tr>
</table>
</body>
</html>





:

But you didn't tell us what type of help you need.

--
Tom [Pepper] Willett
Microsoft MVP - FrontPage
---------------------------
: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
: <html>
: <head>
: <title></title>
: <meta name="GENERATOR" content="Microsoft Visual Studio .NET 7.1">
: <meta name="vs_targetSchema"
: content="http://schemas.microsoft.com/intellisense/ie5">
: <script language="javascript">
: <!-- //
: function WhoAmI(){
: return John Doe;
: }
: // -->
: </script>
: </head>
: <body>
: <table>
: <tr>
: <td><% WhoAmI %></td>
: </tr>
: </table>
: </body>
: </html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top