-
nnerhtml does not work with ajax
hi there
i have a scenario where i am trying to read the value within a div in a html page and pass that value to a server via ajax:
var formname = document.getElementById('username').innerHTML;
$.ajax(
{
type: "POST",
url: "postForm.ajax.php",
dataType: "json",
data:"formname="+formname,
success: function(msg)
{
//do stuff
}
});
paulSm
however it seems as though the dom is generated before the html stuff is complete therefore the variable formname contains null and not "paulSm". Is there any way around this problem?
Any help you can give me would greatly be appreciated
thanks
Similar Threads
-
By quantass in forum AJAX
Replies: 2
Last Post: 04-02-2010, 03:46 PM
-
By dbrook007 in forum AJAX
Replies: 0
Last Post: 04-22-2008, 07:40 AM
-
Replies: 0
Last Post: 06-18-2007, 11:06 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
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|