javascript in ajax opened url

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • esscher
    New Member
    • Feb 2008
    • 5

    javascript in ajax opened url

    I am a ajax newbie so be kind please!
    I'm not sure if my title made sense, but I'll try to be clear about my question.

    Why does the javascript that is in the page that I have requested from xmlHTTPRequest. open not get interpreted/read?

    When I bring back the page, nothing that is in
    <script language="javas cript"></script> gets printed to the screen.

    Does that make sense?

    Esscher
  • ronverdonk
    Recognized Expert Specialist
    • Jul 2006
    • 4259

    #2
    Looks like a puzzle to me. Why don't you show some code and we all know what you are talking about.

    And show any code within the appropriate code tags!

    Ronald

    Comment

    • gits
      Recognized Expert Moderator Expert
      • May 2007
      • 5390

      #3
      hi ...

      that seems like the old problem with simply using ajax to reload entire pages ... that is not the best way to use ajax ... you just should retrieve content to replace it in an existing page. when you load a html-page and set the innerHTML or whatever the page isn't really 'loaded' and so the js-code contained there is not evaluated so you have to evaluate the code explicitly in such a case ...

      kind regards

      Comment

      • esscher
        New Member
        • Feb 2008
        • 5

        #4
        Gits,
        Thats the answer I was looking for, but unfortunatly, not what I wanted to hear. Do you know if there is any way to accomplish reloading of entire pages using ajax? Once I heard about what ajax was capable of, I became very excited because since the day I began using the internet I have disliked the reloading process. I am also looking at Flex to solve this problem, but would rather stick to ajax if its possible. Thanks

        Esscher

        Comment

        • gits
          Recognized Expert Moderator Expert
          • May 2007
          • 5390

          #5
          as i said ... when you 'ajax-load' javascript code you just have to eval() the code explicitly so the best way would be to load it seperatly from the html ... first load the html and process/set it where you want to have it ... now you could load the script and eval it ... with that steps you also avoid the onload-problem when it could occur, since you don't have an onload when you just replace nodes ...

          kind regards

          Comment

          • esscher
            New Member
            • Feb 2008
            • 5

            #6
            I'm going to try that out.. seeing as how I am still learning ajax, it will take some time, but glad to see that it is possible.

            also, I did find some other links on the internet in case anyone else is trying to do the same..



            Comment

            Working...