|
|||||||
| JavaScript JavaScript (not Java) Discussion and technical support, including AJAX and frameworks (JQuery, MooTools, Prototype...) |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Get element using getElementById on an Ajax processed page
Hello guys
Ive got an strange problem with my AJAX and javascript codes I have a page default.asp initiates an ajax call to results.asp then content of this page which is in XML will be placed in a DIV on the default.asp page. The main AJAX script is in a js file which is included in default.asp file. Standard Ajax stuff. In the new contents of the DIV which is loaded from results.asp we have a new DIV which we load some other results from another page This is the DIV in default.asp page which we load resutls from results.asp into that Code:
<div id="first_ajax"></div> Code:
<div id="second_ajax"></div> Code:
<a href="javascript:doThisExternalFunction()">Click here</a> Code:
document.getElementById('second_ajax').innerHTML
Code:
document.getElementById('second_ajax') is null
its strange coz It works fine in IE Thanks in advance |
|
#2
|
||||
|
||||
|
Check if you are calling getElementById after creating the element, consider the rendering timestamp. And also if you are using frames, this can lead to "document" pointer complications. If you post the complete source, or the link to it, more help can be possible my friend.
|
|
#3
|
|||
|
|||
|
Hello
Thanks a lot for ur reply As I said before it is working in IE without any problem, doesn it make sense ? I'll try to put the source here, its a little bit complicated coz its a small part of a big project |
|
#4
|
|||
|
|||
|
Im confused
I just created a demo for that and it workd fine in FF , I don't know why it doesn't work when I have it in my main project ![]() What is that timestamp which u said ? sorry Im not good at javascript |
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|