wood burning stoves 2.0*
The moose likes Servlets and the fly likes JavaScript not loading Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Servlets
Bookmark "JavaScript not loading" Watch "JavaScript not loading" New topic
Author

JavaScript not loading

rakhi sinha
Ranch Hand

Joined: Mar 26, 2012
Posts: 147
Bear Bibeault wrote:Most likely your URLs are not properly formed. You should be using server-relative addresses that start with the context path. see the JspFaq for details.



I am having the same problem. i am using calendar in servlet but java script is not called..calendar is not displayed...code is here. but this code is not working.


Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60810
    
  65

First, why are you emitting all this crud from a Servlet rather than using a JSP.

Secondly, you are using a protocol.

"C:/../calendar.css" will not work ever. First of all, you can't use file protocols on the web and expect things to work on any system other than your own. Do you really think that everyone using your app is going to have your files on their systems? Moreover, that's not even a valid file URL.

See the JspFaq (the entry named ResourceUrlProblems) and modify your resource URLs to use server-relative URLs that begin with the context path.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JavaScript not loading
 
Similar Threads
How to make the previous day from today to be readonly?
document.forms[0].submit(); throws Invalid Argument in IE
Disable future dates in calendar
calendar
calendar