• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

display text string with Javascript on screen

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How to display text string with Javascript on screen?

This is my test page:

I saw only "test docwrite(2);".
I want to see "test 1 hi hello docwrite(2);" with " 1 hi hello" coming from Javascript.
How to do that?
 
author & internet detective
Posts: 41860
908
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Alberto,
First of all, that HTML is malformed. It is missing body tags. With malformed HTML, all bets are off as to what will happen.

If you were to add the body tags, you would run into a second problem. docwrite is called before it is defined. As a result, JavaScript doesn't know anything about a docwrite function. The JavaScript is ignored but doesn't run.
reply
    Bookmark Topic Watch Topic
  • New Topic