DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Ajax within Ajax generated code

  1. #1
    Join Date
    Apr 2007

    Ajax within Ajax generated code

    Does anyone know how to call Ajax from code that was generated from an Ajax call? I have three drop downs that are populated based on the previous selection. Once the third drop down has been selected it uses Ajax to look up the form to display on that page. That all works fine. However, the form that it loads has a call to Ajax within it. The form has a text box that I am trying to create an autosuggest option. The problem is it never makes the call. I don't have any javascript errors.

    I did a little debug using the code generated by the three drop downs being selected. This code includes the form. If copy that code and then try it it works fine, since the first few Ajax calls have not been called.

    Does anyone have any ideas or work arounds for this problem?

  2. #2
    Join Date
    Apr 2007
    Sunny Adelaide

    What exactly do you mean by 'Ajax' in this context? 'AJAX' is just an umbrella term for a combination of technologies. Are you referring to a call to an XMLHttpRequest object? If so, can you post some relevant code? If not, please elaborate a little on what you mean.


    - P

  3. #3
    Join Date
    Sep 2007

    Similar Problem

    I have a similar problem to the one described. I've included some (basic) code to explain my problem - any help would be appreciated.

    <INPUT TYPE="text" NAME="userInput"></INPUT>
    <INPUT TYPE="button" VALUE="OK" ONCLICK="getList(userInput)"></INPUT>
    <DIV id="page1_here"></DIV>
    getList (input) {
      do httpRequest stuff ...
      ... ('POST', 'Page2.jsp', true);
      httpRequest.send('input=' + input);

      get data from database...
      print each record...
        followed by out.println("<DIV ID=\"page2_here_" + recID + "\"></DIV>");
      if (input.equals("domain")) {
        out.println ("<SCRIPT>getData('" + input + "');</SCRIPT>");
    getList (input) {
      do httpRequest stuff ...
      ... ('POST', 'Page3.jsp', true);
      httpRequest.send('input=' + input);
      get data from database...
      print each record...
    If I just load Page2.jsp directly in a browser, the data from Page3.jsp is loaded fine. However when I try to load Page2.jsp within Page1.jsp it only loads the code generated by Page2.jsp and misses the stuff from Page3.jsp.

    Can someone tell me whether this is even possible to do?

Similar Threads

  1. Windows form designer generated code VB
    By Benjamin in forum .NET
    Replies: 2
    Last Post: 04-05-2006, 03:06 AM
  2. New forum + some AJAX links
    By Lori in forum AJAX
    Replies: 0
    Last Post: 02-09-2006, 02:26 PM
  3. Speaking of strings...
    By Harlow in forum .NET
    Replies: 246
    Last Post: 10-26-2002, 12:30 AM
  4. Will VB.NET be more stable than VB6?
    By Jason in forum .NET
    Replies: 125
    Last Post: 10-05-2002, 04:34 PM
  5. Good Editorial by Russell Jones
    By Robert G in forum .NET
    Replies: 84
    Last Post: 02-08-2001, 03:38 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
Latest Articles
Questions? Contact us.
Web Development
Latest Tips
Open Source

   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center