dynamically loaded DIV

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • cmt

    dynamically loaded DIV

    I have a <divon my page that is dynamically loaded via javascript.
    This part works fine, however any javascripts or javascript function
    calls that happen to be in the dynamically loaded content, do not
    work!

    Not even a simple alert('hi!'); works...it's like the browser ignores
    any scripts that are in the dynamically loaded <div>.

    Is there a way around this?

    Thanks!
  • SAM

    #2
    Re: dynamically loaded DIV

    cmt a écrit :
    I have a <divon my page that is dynamically loaded via javascript.
    This part works fine, however any javascripts or javascript function
    calls that happen to be in the dynamically loaded content, do not
    work!
    Which borwser ?
    (all do not react similar)
    Not even a simple alert('hi!'); works...it's like the browser ignores
    any scripts that are in the dynamically loaded <div>.
    I think it can read CSS (In tests that I have done with Firefox)
    Is there a way around this?
    Have a look here to see how and when a browser understands there could
    be a new script :
    <http://members.aol.com/_ht_a/hikksnotathome/loadJSFile/>

    Probably you'll have to
    - create a new element 'script'
    - innerHTML in this new element the script element (its content ?)
    just loaded in the div, or just before to display the responseText
    - then insert this new script in the body or the header

    --
    sm

    Comment

    • sheldonlg

      #3
      Re: dynamically loaded DIV

      cmt wrote:
      I have a <divon my page that is dynamically loaded via javascript.
      This part works fine, however any javascripts or javascript function
      calls that happen to be in the dynamically loaded content, do not
      work!
      >
      Not even a simple alert('hi!'); works...it's like the browser ignores
      any scripts that are in the dynamically loaded <div>.
      >
      Is there a way around this?
      >
      Thanks!
      I have written javascript calls inside a dynamically written <divin a
      return from AJAX (which is then handled by javascript). Those calls
      worked. Can you show your code?

      Comment

      Working...