using ajax to fill html li

Goambabiniunk

New Member
I currently have a list of items which should be partly filled by an AJAX call. What I have:\[code\]<li>Hello, username</li>\[/code\]The AJAX call pulls the username from a database. So how do you append that pulled information to display it next to "Hello" since anything in the \[code\]li\[/code\] tags is straight text? The AJAX:\[code\]ajax({ type: "GET" url: '../info success: function (data){ if (data != ''){ var user = info.username; } } })\[/code\]How would the variable user be put in to the list item tag? can you do something like \[code\]<li>Hello, "$user"</li>\[/code\]
 
Back
Top