Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    javascript to java

    hi frnds,
    There exists an escape function in javascript ,can anyone plz tell me how cn this function be used in java?or in general,how cn any function in javascript be used in java?but i m a bit more specific bout escape function

  • #2
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Well that is either a very easy question to answer or a very hard one. JavaScript and Java are completely different languages. So in general, there really is no way to use the functionality of one in another. The function escape(), if that is the one you were talking about, takes a string and converts it to a URL safe string (converts spaces in to %20 and such). There may be more than one function that does this in java but I think one of them is URLEncoder.encode() which does a similar function.

    Now the complex side. Since JavaScript is interpreted, there is a way to run JavaScript in an actual interpreter inside Java. And there is a way to interface with Java in a browser through JavaScript. Hopefully your question is the easier one though because I'm not sure I even understand the full answer to the harder one.

    Good luck.

    david_kw

  • #3
    New to the CF scene
    Join Date
    Apr 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for the reply,
    actually i m new to java ,cud u tell me wat does urlencode.encoder() ,do?

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,017
    Thanks
    203
    Thanked 2,538 Times in 2,516 Posts
    Quote Originally Posted by tmendhekar View Post
    thanks for the reply,
    actually i m new to java ,cud u tell me wat does urlencode.encoder() ,do?
    Nothing, or throws an error message. It should be URLencode.encode()

    For examples try Google. See for example:-

    http://www.devx.com/tips/Tip/18188

    But as David has pointed out, this is the JavaSCRIPT forum.

  • #5
    Senior Coder
    Join Date
    Nov 2006
    Posts
    1,000
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Also look at

    http://www.docjar.com/docs/api/java/net/URLEncoder.html

    Further Java questions should be addressed to this forum.

    http://www.codingforums.com/java-jsp/

    david_kw


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •