DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Divs not accessible

  1. #1
    Join Date
    Apr 2007

    Question Divs not accessible


    I'm creating a CMS using Ajax.
    So I'm updating the page all the time, but there's a problem.
    I'm loading a module into a div.

    <div id="module">
    this div will be filled using an Ajax function.
    the update appears on the screen.
    the contents of the div should then be:

    <div id="text"> </div>
    another function should fill this div.
    and that's the problem. the div cannot be found, because it just doesn't exist in the source.
    the first function loads it on screen, but doesn't load the real source, so i can't use it with other javascript / ajax functions.

    Is there a solution to this problem?

    Hope someone can help me!

    Last edited by LeanderD; 04-14-2007 at 10:05 AM.

  2. #2
    Join Date
    Apr 2007

    Same problem here too...

    I am having a similiar problem where I have a DIV InnerHTML loaded from an AJAX call with a form. The HTML DOM does not recognize any of my form objects after they are returned to the page.

    The issue seems to be that the DOM only generates the object model based on the original page loading. My research continues, however, it seems the resolution centers around having to "update" the DOM with the objects that are added to the page through an AJAX response.

    If anyone has some code that performs this process in a more general way I would appreciate it. Otherwise, it seems that the "on status change" callback function provided to the http object will need to include javascript code to update the DOM with each object name.

  3. #3
    Join Date
    Apr 2007
    someone told me I should use createElement instead of innerHTML. My problem is solved somehow, but i didn't use createElement. I've just rewritten my code in another way.

    but this is what someone gave me about the createElement code:
    var moduleDiv = document.getElementById('module');
    var textDiv = document.createElement('div');
    var imgImage = document.createElement('img');
    imgImage.src = 'images/textHeader.png';
    it's not much, but i hope it helps!

Similar Threads

  1. Javascript problem with visible DIVs
    By Wildcatbob in forum Web
    Replies: 13
    Last Post: 07-05-2006, 11:47 AM
  2. Help with DIV's and custom scrollbars
    By Jason Holt in forum Web
    Replies: 0
    Last Post: 05-26-2001, 10:16 PM
  3. manipulating divs on the fly
    By Jason in forum Web
    Replies: 4
    Last Post: 04-01-2001, 03:26 AM
  4. Replies: 0
    Last Post: 11-24-2000, 04:46 AM
  5. Netscape/IE hide/show DIV's
    By Chris Raethke in forum Web
    Replies: 1
    Last Post: 09-25-2000, 02:07 AM

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