This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes javascript not working in my computer Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "javascript not working in my computer" Watch "javascript not working in my computer" New topic
Author

javascript not working in my computer

Mainak Goswami
Ranch Hand

Joined: May 21, 2006
Posts: 50

Hi,

In my PC java script is not working. I am using a simple Html page with java script embedded in it: e.g.

<html>
<body>
<script language=�JavaScript�>
Document.write(�Hello�);
</script>
</body>
</html>

I have tried to run this html page with different browsers : IE6 , Mozilla,netscape.. But no output is given. Can anyone please help me in this regard?

Does anything depends on the version of the Windows or on the JRE version?

Thanks
Mainak


------------------------------------
Mainak
idiotechie
------------------------------------
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41089
    
  44
JavaScript is case-sensitive. Try "document" instead of "Document". Then it works fine for me on Firefox. JavaScript has nothing to do with Java, by the way, so the JRE version is irrelevant.


Ping & DNS - my free Android networking tools app
Mainak Goswami
Ranch Hand

Joined: May 21, 2006
Posts: 50

By mistake i have written here "D"ocument ....However I have been trying with document.write().

Actually it is not working for any java script commands. E.g. alert

Please let me know if any of the versions of the windows / JRE prohibits this.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41089
    
  44
Works fine in IE as well, with "d", but not with "D". Make sure you use proper quotes and double-quotes, not the curly ones you used in your post. In Firefox you can see JavaScript errors in the JavaScript Console, which you'll find in the Tools menu. It's got nothing to do with the Windows version, and neither -see above- with the JRE version.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
where are you running this file system (desktop) or on a server part on your computer, or from the web?

Eric
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: javascript not working in my computer
 
Similar Threads
Jscript is not running in IE
jsp and javascript
JavaScript function in HTML body
Not accessing or saving data in browser in a Web Start application
JSF page Declarations