SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Thread: xmlhttprequest

  1. #1
    SitePoint Member
    Join Date
    Jun 2006
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question xmlhttprequest

    Hi @

    I have an aspx page say first.aspx which invokes an asp page (second.asp) using xmlhttprequest.

    But any javascript code on the second.asp does not get executed.
    I want to use a document.location command on the second.asp.

    Is this how it is supposed to work?

    Thanks
    Clara

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    When you grab a page using xmlhttp, you are essentially getting a big string of the page contents which you then do something with (like insert into a div, if it's html). All of the html that exists on the grabbed page is being used in the context of the first page, ie, it's not the same as calling that grabbed page directly.

    That means that if you have javascript in the grabbed page, it won't run as if you had navigated directly to that page. It's much more complicated to get it to run. Ask yourself if you really need to use xmlhttp if it's essential for that javascript to run.


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
  •