Posts: 3,985
Name: Abel Mohler
Location: Asheville, North Carolina USA
|
It makes no difference whether code is viewable in the static HTML or not, as long as it is loaded in the DOM, it is accessible via normal methods. The problem is, you can't just plop a command just anywhere in your script, and expect it to read what you're loading via an AJAX call. You can only access that content once it has loaded, which means you must wait for the onreadystatechange event before you try to access it. If you read the DOM from that callback, and after you have inserted the content, you should have no problems.
|