469,331 Members | 5,388 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,331 developers. It's quick & easy.

calling external files from ajax pages

67
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.
Aug 11 '08 #1
1 946
rnd me
427 Expert 256MB
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.
Aug 11 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.

Similar topics

9 posts views Thread by Charley Kyd | last post: by
2 posts views Thread by Jeff Allan | last post: by
1 post views Thread by Danny | last post: by
reply views Thread by msch.prv | last post: by
reply views Thread by Purva khokhar | last post: by
1 post views Thread by haryvincent176 | last post: by
1 post views Thread by Marylou17 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.