Win a copy of Reactive Streams in Java: Concurrency with RxJava, Reactor, and Akka Streams this week in the Reactive Progamming forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Tim Cooke
  • Devaka Cooray
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Ganesh Patekar

display text string with Javascript on screen

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
  • 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: 39530
776
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
  • 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.
 
Create symphonies in seed and soil. For this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!