3

I am tring to use java.lang.String inside my javascript file. But this fails in IE.

Is there a workaround for IE.

This is what I'm trying to do.

var byteArray = (new java.lang.String("asdf")).getBytes();
6
  • 3
    I don't understand? You are aware that Java and JavaScript have nothing directly to do with each other? Are you looking for a JS alternative to this? Commented Dec 13, 2010 at 16:46
  • 4
    why the hell are you using java inside of javascript ? oO Commented Dec 13, 2010 at 16:46
  • Might want to read this... en.wikipedia.org/wiki/Javascript Commented Dec 13, 2010 at 16:48
  • That code works perfectly fine in firefox. IE creates some problem. I know Java and js are different. That doesnt prevent anyone from using java in js... Commented Dec 13, 2010 at 16:50
  • 2
    Actually people you can code Java in JavaScript. docstore.mik.ua/orelly/webprog/jscript/ch22_03.htm Would I be caught doing this insane stuff? Nope. lol Commented Dec 13, 2010 at 16:51

2 Answers 2

5

Unlike Firefox, Internet Explorer cannot interact with Java.

Sign up to request clarification or add additional context in comments.

Comments

1

Unlike Firefox; IE doesn't have direct access to the Java libraries and it would be somewhat insane to 1.) assume Java is installed 2.) use the Java libraries within client side script.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.