473,320 Members | 2,112 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How to add Ajax loaded HTML to the page DOM ?

Hi everyone,

I have a HTML page and I'm replacing a div by some HTML code using Ajax.

The problem is that I cannot access the newly added HTML tags as their IDs are not part of the original page DOM, so getElementById etc won't work.

How can I add the loaded HTML (or XML) to the current page DOM? Note that I'm also using prototype, does pt offer a way to resolve this kind of problem?

Best regards
Haderach
Apr 17 '07 #1
2 1610
acoder
16,027 Expert Mod 8TB
Once the HTML is added to the page, the elements should be accessible.
Feb 4 '08 #2
myth0s
32
Hi everyone,

I have a HTML page and I'm replacing a div by some HTML code using Ajax.

The problem is that I cannot access the newly added HTML tags as their IDs are not part of the original page DOM, so getElementById etc won't work.

How can I add the loaded HTML (or XML) to the current page DOM? Note that I'm also using prototype, does pt offer a way to resolve this kind of problem?

Best regards
Haderach
The DOM is dynamic. So as long as you set the ID of the elements you add, everything should be fine.
Feb 4 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: petermichaux | last post by:
Hi, I am trying to put together the last major pieces of my project's puzzle. This is more website/client-side architecture than JavaScript syntax but I hope this is a good place to ask. I'm a...
5
by: Martin | last post by:
Hello NG, I've been doing some AJAX for a few weeks now. The basics worked fine so far, but now I've got the following problem which I can't solve: With AJAX you typically update/replace only...
1
by: geevaa | last post by:
http://www.phpbuilder.com/columns/kassemi20050606.php3 XMLHttpRequest and AJAX for PHP programmers James Kassemi Introduction: Although the concept isn't entirely new, XMLHttpRequest...
6
by: John Doe | last post by:
Here's my issue: I have an instant messenger type feature for my site, its basically an ajax IM feature. I run with a mysql backend on the site, i have a div on my main page that runs a javascript...
1
by: abaybas | last post by:
I'm creating a page in which a certain "content" part of the page is refreshed using ajax. I do this by using a div#content, and it's child div#container. the code: ... ...
1
by: nicky77 | last post by:
Hi, apologies in advance is this may be a nonsensical ramble, but I'm hoping someone can give me some advice on how to solve the following problem: I'm developing a site where the main content is...
3
by: krg | last post by:
Hi, I started writing this blog some time back and it would be great if I could get an audience here and even better if we could have a conversation about developments possible on the techniques I...
10
by: =?Utf-8?B?RGFuaQ==?= | last post by:
Hi, Trying to create a master page that holds a menu, and the menu switches between pages in the site. 2 problem arrosed: a. When I navigate from page to page (all AJAX Web Forms, with the...
3
by: pablosuk78 | last post by:
Dear coders, I'm facing a problem and after few research I found that many ppl were looking around for the same solution, hope someone more expert than me could give a good help. I created an...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.