Question : Javascript innerHTML issue

Hello experts,

I'm now trying to trigger a function after I fill a div with innerHTML method.
In other words along with the result of the AJAX page execution I'd like to throw a JS function like in the snippet below , but nothing seems to happen.

Have you got any suggestion to sort this thing out ?

Many thanks in advance
Alex
Code Snippet:
1:
2:
3:
//function GetLogin is properly included in the HTML page and no JS 
error comes up 
ResponseDiv.innerHTML = "
User successfully created
"
Open in New Window Select All

Answer : Javascript innerHTML issue

>>In other words along with the result of the AJAX page execution I'd like to throw a JS function like in the snippet below , but nothing seems to happen.

the browser will not let you "inject" script blocks with "internal/inline" js content/code. You can insert script blocks/tags that have NO "internal" code but refer to some external file:
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
ResponseDiv.innerHTML = "
User successfully created
" So, if your browser code currently looks similar to this: " }; ... then instead of trying to insert that function call dynamically, you need to call it right after you assign the content to the div: If your problem persists, post all your code OR post a url to your page.
Open in New Window Select All
Random Solutions  
 
programming4us programming4us