Ajax requested page doesn't run javascript

Discussion in 'Javascript' started by sgmaat@gmail.com, Apr 13, 2006.

  1. Guest

    I have create a AJAX webpage where if you press a link content is
    loaded into a div. NOw when this content is loaded no javascript is
    processed (i.e <Script>alert(..);</script>), but if the javascript is
    in <a onclick="..."> it will work.
    What i would like to know is:
    - Is this normal
    - What do i need to change so that javascript does get processed?

    Thanks in advance,
    Stephan Maat
     
    , Apr 13, 2006
    #1
    1. Advertising

  2. Guest

    Hi Stephan,

    wrote:
    > I have create a AJAX webpage where if you press a link content is
    > loaded into a div. NOw when this content is loaded no javascript is
    > processed (i.e <Script>alert(..);</script>), but if the javascript is
    > in <a onclick="..."> it will work.
    > What i would like to know is:
    > - Is this normal
    > - What do i need to change so that javascript does get processed?


    Yes it seems to be normal that the javascript in script tags isn't
    processed. The javascript in the onclick gets processed when the click
    occurs, or so it seems.

    Yesterday I went through this very same thing and asked about it here.
    The thread was called "run JavaScript that is part of AJAX response".
    Lasse gave me some great advice about how to deal with this in my
    situation.

    http://groups.google.com/group/comp...845a4/a89890b18d005e9e?hl=en#a89890b18d005e9e

    It is interesting to note that the Prototype.js Ajax.Updater() function
    seems to automatically run the javascript when it inserts the AJAX
    response. This is why I've temporarily reverted to using the
    Prototype.js library for AJAX until I can try writing some higher level
    functions for the Yahoo! UI connection library.

    Peter
     
    , Apr 13, 2006
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. J Gao
    Replies:
    0
    Views:
    1,213
    J Gao
    Jul 28, 2003
  2. =?Utf-8?B?Y2h1Y2sgcnVkb2xwaA==?=

    Getting ASPX code to run when .asp is requested

    =?Utf-8?B?Y2h1Y2sgcnVkb2xwaA==?=, Sep 20, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    2,787
    =?Utf-8?B?Y2h1Y2sgcnVkb2xwaA==?=
    Sep 23, 2005
  3. Replies:
    0
    Views:
    362
  4. minnie
    Replies:
    1
    Views:
    711
    Andrew Thompson
    Dec 13, 2006
  5. adam
    Replies:
    0
    Views:
    307
Loading...

Share This Page