calling external files from ajax pages

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kigoobe
    New Member
    • May 2007
    • 67

    calling external files from ajax pages

    Hi

    I'm having a few issues and was wondering if I could get some help from here.

    Well, we call ajax from a page with an event handler, like onclick. Then, we have a second page where we have our code that gets executed and shows in the first page.

    How can we have an external js or css file associated with the second page? I mean, if the second page is only about echoing date like echo date("Y-m-d"); it's simpler, but what about if that second page holds a form, and needs some external javascript and css file to work.

    Where and how should we have those files? In a traditional page, we will include the files inside the <head> of the page, but here since we don't have a head for the second page, how to do this?

    Any help / tips?
    Thanks.
  • rnd me
    Recognized Expert Contributor
    • Jun 2007
    • 427

    #2
    typically, the inner content of a tag is injected into the container usinng .innerHTML or document.write

    you need to match up the target with the response, and format the response in a format appropriate to the type of data expected in the target container be it json, html, css, or whatever.

    Comment

    Working...