Page 1 of 3 123 LastLast
Results 1 to 10 of 24

Thread: AJAX call function

  1. #1
    Join Date
    May 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation AJAX call function

    i have all my functions in a java class file....how do i call the function using ajax? does anyone know?

    izzit possible to call the java function from the class file by ajax?
    plz let me know if u know...
    quite urgent...thx very much..

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    link?
    why?
    more info?


    I mean.... I don't know myself, but it's a pretty general question.

    You need to call a remote function on a different page via ajax?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    What's a class file?

    Do you mean a .js file?

    If so, as long as the file is available to the page, you may use its functions. You can also use the DOM to make the file available. There are scripts here on DD (and probably elsewhere) that (among other things) 'load' .js files on a page.

    See:

    http://www.dynamicdrive.com/dynamicindex17/indexb.html

    These scripts do this by creating a script tag element, assigning the .js file as its src attribute, and attaching it to the head element of the page. Although these actions are used with scrips that also use AJAX to load content, this part (loading a script) is purely a DOM operation.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by John
    What's a class file?
    A class file is a file containing a Java class.

    melvinoyh: Is it a server-side or a client-side class? Should it be used in an applet, or a servlet?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey
    A class file is a file containing a Java class.

    melvinoyh: Is it a server-side or a client-side class? Should it be used in an applet, or a servlet?
    Geez, I knew that. I got so used to folks saying java and meaning javascript, I thought this was the case here. After all, this is the javascript forum.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Unfortunately, we haven't a Java forum.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  7. #7
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Anyways, the OP may still be able to write a tag for the class using the DOM. In fact, with IE these days, any sort of object/embed is best done that way or with innerHTML or document.write (for this, all of these are best run from an external .js file) to avoid the 'click to activate this control' 'security feature' that MS recently added - not their finest hour.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  8. #8
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Quote Originally Posted by John
    Anyways, the OP may still be able to write a tag for the class using the DOM.
    Not if it's a server-side JSP page, to which I believe s/he is referring. There is no other reason to use AJAX, or to want to simply call a function and do nothing with the result, of which I can think.
    not their finest hour.
    Not their lowest, either
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  9. #9
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey
    Not if it's a server-side JSP page, to which I believe s/he is referring. There is no other reason to use AJAX, or to want to simply call a function and do nothing with the result, of which I can think.Not their lowest, either
    Well, let's not get too excited until we find out what the reason(s) is/are and what type the class is.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  10. #10
    Join Date
    May 2006
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    its a java class file that contain java function.
    yes, its a server side JSP page that have AJAX use POST method to post data to server and call the function in the java class file to perform some processing and return back the processed info back to jsp page...
    how to do so?

Bookmarks

Posting Permissions

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