471,892 Members | 2,118 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,892 software developers and data experts.

calling external files from ajax pages


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?
Aug 11 '08 #1
1 1044
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 zermasroor | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.