View Full Version : general javascript question
gcapp
11-18-2002, 01:54 PM
I have a general javascript question. It may apply in this forum but maybe in the asp forum.
I have a java applet on a site that I am building. If someone visiting the site doesn't have their javascript turned on, and chooses not to, is there some line of code that I can use that will detect that and replace the applet for an image I create?
The site is developed in asp, but being that it is a javascript question, I thought it may apply here.
Gary
duniyadnd
11-18-2002, 02:41 PM
When you say Java Applet, I presume the language Sun Microsystems developed, which is different from JavaScripting. In that case, you just have to make sure that your OS can run Java applets, I think WinXP has problems running Java Applets, but Sun has come up with patches to run it, not sure about that information though. JavaScript is something else though.
Duniyadnd
Iceheart
12-04-2009, 10:13 AM
I think if the JavaScript availability thing is turned off, I think (but I am just thinking it) there's no JavaScript code that will run.
But I think you can use another web programming language for that thing (I think VBScript is an alternative.)
P.S : Sorry but I don't know a line of code to do that thing (and I don't want to think about it because it will stress me). But I hope you will find the code (or will create it )
Philip M
12-04-2009, 10:17 AM
I have a java applet on a site that I am building.
Java and Javascript are entirely different programming languages, in spite of the confusingly similar names.
If a user chooses to disable either then there is nothing you can do about it.
See: http://www.javatester.org/enabled.html
VBScript is of course IE only.
VIPStephan
12-04-2009, 11:02 AM
someone visiting the site doesn't have their javascript turned on, and chooses not to, is there some line of code that I can use that will detect that and replace the applet for an image I create?
This is a perfect example for the approach of progressive enhancement (http://www.alistapart.com/articles/progressiveenhancementwithjavascript/). If JS is disabled it won’t be executed at all. So, what you do is have the image there by default and then use JavaScript to remove the image from the document and replace it with whatever you like. Therefore it will only be replaced if JS is available in the first place, you don’t have to check if it’s available.
Old Pedant
12-05-2009, 03:09 AM
But how do you replace the image if you really *are* using a Java Applet, not JavaScript??
And I'm just curious why the original poster would think either question--JavaScript or Java--might need to be in the ASP forum. [twilight zone music plays in background]
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.