Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Feeding JavaScript through servlets

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
A colleague of mine is working with Java servlets and is experiencing problems when trying to deliver javascript to the server. She is able to create a string and push this back to the server (from the servlet) in order to create HTML pages on the fly. However when passing javascript to the server she is not seeing the required results. The button on the page produced is supposed to run a function when clicked (according to a javascript function) but on clicking the button she is presented with a message indicating something like 'function not recognised'. Is it just a case of formatting the string being pushed back to the server to maintain the javascript or are we overlooking something ?
Can anyone give us some help with this ?
Thanks in advance.
Steve
 
Hi Steve,

What you can do is take a look at the source code of the dynamically created html page (right click, view source). Make sure that the source code tally with what you are supposed to have. If it doesn't tally, then either something went wrong when passing the string to your server or there is something wrong with your servlet.

If it tally, then double check that your javascript does not contain any error.

I have just done a servlet that creates a html page with javascript in it today and it is working fine. However I didn't pass any javascript codes to the server but I guess it will work fine for your case too.

If possible, maybe you would like to paste ur souce code as well so that it would be easier to find out the fault?

Regards,
Leon If you need additional help, you can email to me at zaoliang@hotmail.com I don't guaranty that I will be able to solve your problems but I will try my best :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top