Results 1 to 3 of 3

Thread: Script Not working

  1. #1
    Join Date
    Oct 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Cool Script Not working

    I'm loading a page dynamically using XMLHttpRequest object. The page that I'm downloading uses an external JavaScript file and after loading content, it calls for a function in that external JavaScript file. When I click on a link, that page will be loaded dynamically using XMLHttpRequest object. But What happening is, that method is not getting called (I placed an alert in that external JavaScript function for debugging purpose). At the same time, if I use that responseText and create a new file with it, then that page is working perfectly and it is calling that JavaScript function and I'm getting alert. What is the problem and what is the solution for it? Help me.

    Thanks in Advance.

  2. #2
    Join Date
    Aug 2007
    Location
    Somewhere in the vicinity of Betelgeuse
    Posts
    23
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    I suspect this is because you have an inline script in the page you are loading dynamically. Inline scripts are not evaluated when they are appended to the page. If you have a look at any of the big Ajax frameworks (Prototype for example), you'll see that they strip the <script> tags out of the loaded page, append the content, and eval the scripts a millisecond or so later.

  3. #3
    Join Date
    Oct 2007
    Posts
    15
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by Mr Moo View Post
    I suspect this is because you have an inline script in the page you are loading dynamically. Inline scripts are not evaluated when they are appended to the page. If you have a look at any of the big Ajax frameworks (Prototype for example), you'll see that they strip the <script> tags out of the loaded page, append the content, and eval the scripts a millisecond or so later.
    Then please provide me a solution for it as I have to call those functions and provide me an example if possible that explains the usage of inline script tags.

    Thank you very much...

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •