By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,384 Members | 1,886 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,384 IT Pros & Developers. It's quick & easy.

calling external files from ajax pages

P: 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
Share this Question
Share on Google+
1 Reply


rnd me
Expert 100+
P: 427
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.