|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Help With HTML<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> Ryan wrote:
> <script language="javascript"> Shouldn't that be:> <!-- // > function WhoAmI(){ > return John Doe; > } > // --> > </script> return 'Admiral Stockdale'; ? <bg> More seriously, did you have an actual question? 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. -- Show quoteHide quoteRon 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> 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> > > But you didn't tell us what type of help you need.
-- Show quoteHide quoteTom [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> 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> > > > 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. 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> 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> > > > 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. 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) -- Show quoteHide quoteRon 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: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> >> >> >> 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> >> >> >>
Other interesting topics
Use of <a href> tag
problem with css format for hyperlink Behaviors, on click go to url, swap image, swap image restore Using SSI on Home Page Database Results Photo gallery slide show error Front Page 2003 on other computers Two questoins, behaviors and pages Excel component won't display Flash Buttons. |
|||||||||||||||||||||||