• 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

Java script functions in Servlet Output

 
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello ,
This is similar to what I posted earlier - but thought would break up the two issues separately -

Here is what I am trying to do :

I am trying to get dynamic content in a HTML
for this purpose I am using Java Script to make a call to a servlet

Here is the code in the Html file


This works fine and I am able to reach my servlet

Since I am using Javascript in the servlet too to generate output I am using Document.write

Here is an excerpt of the code from the servlet


The problem is :
1 > The Javascript function of alert does not work at all

Is there a way of making Javascript functions work when I use Document.write in servlet to generate java script functions

Please help

Regards,
-satish
 
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
Satish,
That code looks like it doesn't compile. It's missing the escape before the quotes around the word "hi."

What error do you get when you try this? Does the generated HTML look right?
 
We're all out of roofs. But we still have tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic