Home All Groups Group Topic Archive Search About
Author
15 May 2009 6:02 PM
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>

Author
15 May 2009 6:18 PM
Karl E. Peterson
Ryan wrote:
> <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?
--
..NET: It's About Trust!
http://vfred.mvps.org
Are all your drivers up to date? click for free checkup

Author
15 May 2009 6:19 PM
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.



Show quoteHide quote
"Ryan" <R***@discussions.microsoft.com> wrote in message
news:BED64720-4FB1-4B28-B7B6-F6F4523E0B15@microsoft.com...
> <!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>
Author
15 May 2009 8:08 PM
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>

Show quoteHide quote
"Ronx" wrote:

> 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.
>
>
>
> "Ryan" <R***@discussions.microsoft.com> wrote in message
> news:BED64720-4FB1-4B28-B7B6-F6F4523E0B15@microsoft.com...
> > <!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>
>
>
Author
15 May 2009 6:22 PM
Tom [Pepper] Willett
But you didn't tell us what type of help you need.

--
Tom [Pepper] Willett
Microsoft MVP - FrontPage
---------------------------
Show quoteHide quote
"Ryan" <R***@discussions.microsoft.com> wrote in message
news:BED64720-4FB1-4B28-B7B6-F6F4523E0B15@microsoft.com...
: <!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>
Author
15 May 2009 7:55 PM
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>





Show quoteHide quote
"Tom [Pepper] Willett" wrote:

> But you didn't tell us what type of help you need.
>
> --
> Tom [Pepper] Willett
> Microsoft MVP - FrontPage
> ---------------------------
> "Ryan" <R***@discussions.microsoft.com> wrote in message
> news:BED64720-4FB1-4B28-B7B6-F6F4523E0B15@microsoft.com...
> : <!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>
>
>
>
Author
15 May 2009 9:10 PM
Karl E. Peterson
Ryan wrote:
> 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



Show quoteHide quote
> <!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" wrote:
>
>> But you didn't tell us what type of help you need.
>>
>> --
>> Tom [Pepper] Willett
>> Microsoft MVP - FrontPage
>> ---------------------------
>> "Ryan" <R***@discussions.microsoft.com> wrote in message
>> news:BED64720-4FB1-4B28-B7B6-F6F4523E0B15@microsoft.com...
>> : <!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>
Author
15 May 2009 10:40 PM
Ryan
It works fine on the server but won't run on local machine.

Show quoteHide quote
"Karl E. Peterson" wrote:

> Ryan wrote:
> > 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" wrote:
> >
> >> But you didn't tell us what type of help you need.
> >>
> >> --
> >> Tom [Pepper] Willett
> >> Microsoft MVP - FrontPage
> >> ---------------------------
> >> "Ryan" <R***@discussions.microsoft.com> wrote in message
> >> news:BED64720-4FB1-4B28-B7B6-F6F4523E0B15@microsoft.com...
> >> : <!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>
>
>
>
Author
15 May 2009 10:47 PM
Karl E. Peterson
Ryan wrote:
> 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.
--
..NET: It's About Trust!
http://vfred.mvps.org
Author
16 May 2009 9:04 AM
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.



Show quoteHide quote
"Ryan" <R***@discussions.microsoft.com> wrote in message
news:E961D452-1B4D-411F-8AD1-34B82FBB3ED0@microsoft.com...
> It works fine on the server but won't run on local machine.
>
> "Karl E. Peterson" wrote:
>
>> Ryan wrote:
>> > 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" wrote:
>> >
>> >> But you didn't tell us what type of help you need.
>> >>
>> >> --
>> >> Tom [Pepper] Willett
>> >> Microsoft MVP - FrontPage
>> >> ---------------------------
>> >> "Ryan" <R***@discussions.microsoft.com> wrote in message
>> >> news:BED64720-4FB1-4B28-B7B6-F6F4523E0B15@microsoft.com...
>> >> : <!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>
>>
>>
>>
Author
16 May 2009 7:18 PM
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

Show quoteHide quote
"Ryan" <R***@discussions.microsoft.com> wrote in message
news:E961D452-1B4D-411F-8AD1-34B82FBB3ED0@microsoft.com...
> It works fine on the server but won't run on local machine.
>
> "Karl E. Peterson" wrote:
>
>> Ryan wrote:
>> > 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" wrote:
>> >
>> >> But you didn't tell us what type of help you need.
>> >>
>> >> --
>> >> Tom [Pepper] Willett
>> >> Microsoft MVP - FrontPage
>> >> ---------------------------
>> >> "Ryan" <R***@discussions.microsoft.com> wrote in message
>> >> news:BED64720-4FB1-4B28-B7B6-F6F4523E0B15@microsoft.com...
>> >> : <!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>
>>
>>
>>

Bookmark and Share