473,376 Members | 1,079 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,376 software developers and data experts.

DOM appendChild() after the closing tag of an element

bilibytes
128 100+
Hi,

i am trying to append an list [HTML]<ul></ul>[/HTML]element after another element which is also a [HTML]<ul></ul>[/HTML] to make it look like this
[HTML]
<ul id="frist_list">
<li>some text</li>
<li>some text</li>
<li>some text</li>
</ul>

<ul id="second_list">
<li>some text</li>
<li>some text</li>
<li>some text</li>
</ul>
[/HTML]

so using xmlHttpRequest i get the second_list which i want to insert into the html document like this...
i would try with appendChild(XHR.responseText) but i dont know what to append to...

thank you

bilibytes
Sep 15 '08 #1
3 5628
acoder
16,027 Expert Mod 8TB
You need to use something like insertAfter() except that there's no insertAfter method, so you'll need a combination of insertBefore and nextSibling - see link.

PS. This doesn't belong in Coldfusion. Moved to the JavaScript forum.
Sep 15 '08 #2
bilibytes
128 100+
You need to use something like insertAfter() except that there's no insertAfter method, so you'll need a combination of insertBefore and nextSibling - see link.

PS. This doesn't belong in Coldfusion. Moved to the JavaScript forum.
Thankyou very much!
PS. i missclicked on the menu bar sorry.
Sep 15 '08 #3
acoder
16,027 Expert Mod 8TB
No problem. Glad your problem's solved.
Sep 15 '08 #4

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

Similar topics

25
by: kie | last post by:
hello, i have a table that creates and deletes rows dynamically using createElement, appendChild, removeChild. when i have added the required amount of rows and input my data, i would like to...
6
by: skubik | last post by:
Hi everyone. I'm attempting to write a Javascript that will create a form within a brand-new document in a specific frame of a frameset. The problem is that I can create the form and input...
1
by: Ryan Stewart | last post by:
If you don't want to read this post because of its length, I understand. I've spent two and a half days on this problem and have a good deal of information to relate. And this is kind of a long...
3
by: jacster | last post by:
Hi, I'm using the following code in a Greasemonkey script. var start, newElement; start = document.body; newElement = document.createElement('b'); newText = document.createTextNode("The...
6
by: Andrew Poulos | last post by:
I'm trying to append a form element to a form like so: var frm = document.createElement("FORM"); frm.method = "post"; frm.action = "include/writeData.asp"; var ff, values = ; for (var i=0;...
3
by: Robi | last post by:
I have the following code: ############## var nHead=(document.getElementsByTagName)?document.getElementsByTagName("head").item(0):document.head; var nStyle=document.createElement("style"); //...
2
by: samuel.adam | last post by:
Hi all, I am coding an AJAX DHTML whatever application and I was fed up with always typing a lot of appendChild() functions. I created a custom one called append_children() and wanted to share...
15
by: Jake Barnes | last post by:
I'm trying to learn AJAX so tonight I sat down and came up with a little toy that I can do tests with. You can see it here: http://www.publicdomainsoftware.org/ajaxExperiment.htm I've got...
2
by: sicapitan | last post by:
The appendChild to the row_container works a treat, while column_container remainds blank, and it appears at the bottom of my document Hmm, here is my code : function initGrid() { row_id =...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.