BillBris
07-18-2007, 08:43 AM
Hello, and if this is incredibly stupid, please forgive me!
I'm proficient with PHP, and not so much with Javascript and Ajax (BTW, Ajax is great!). I've got Ajax working, and understand the overall concepts. No problem there. The real problem I'm having is this...
- I'm creating a play website for learning.
- I have one main page (all CSS, no tables, etc.)
- One left-hand <div> with menu options, and another right-hand <div> that will contain the contents of the "page" selected in the menu. The basic idea is to create a website that has zero refreshes, via Ajax. Each content page that appears in the right-hand <div> is in it's own PHP page.
So far, this works just fine. The problem(s) I'm running into came about when I created a <form>. The form appears just fine in the content <div>, however, I found that all of my form-specific CSS code in the content PHP file was ignored, dropped, whatever. When I moved this CSS code to the original page (index.php) everything worked as expected.
So, Question #1: Is there a way to nest CSS within the PHP file retrieved by Ajax? BTW, the PHP is some PHP and some HTML, etc., the <?PHP and ?> do not encompass all of the code in the file. Right now, it seems as if ALL of the CSS code must be available when the initial page is loaded. This doesn't seem right.
Within the above mentioned <form> I have a list of countries. The "onchange" event on the <select> object is to trigger a javascript function that will lead to an Ajax call to get a list of States, Provinces, etc. when the Country changes. The javascript function, "foo" is in the PHP file that creates the <form>. The error I'm getting says that "foo" is not found, and the error line listed is in my "index.php" file rather than the file that was loaded via Ajax.
Basically, this is the same problem (I think) with my architecture. I really want the content <div> to be CSS'd, and Javascript'able on it's own, isolated as it were.
Keep in mind, all I want to accomplish is a complete site with no refreshes.
If this is not clear, I apologize. I'm happy to clear up anything that is fuzzy.
Thanks in advance,
B.
I'm proficient with PHP, and not so much with Javascript and Ajax (BTW, Ajax is great!). I've got Ajax working, and understand the overall concepts. No problem there. The real problem I'm having is this...
- I'm creating a play website for learning.
- I have one main page (all CSS, no tables, etc.)
- One left-hand <div> with menu options, and another right-hand <div> that will contain the contents of the "page" selected in the menu. The basic idea is to create a website that has zero refreshes, via Ajax. Each content page that appears in the right-hand <div> is in it's own PHP page.
So far, this works just fine. The problem(s) I'm running into came about when I created a <form>. The form appears just fine in the content <div>, however, I found that all of my form-specific CSS code in the content PHP file was ignored, dropped, whatever. When I moved this CSS code to the original page (index.php) everything worked as expected.
So, Question #1: Is there a way to nest CSS within the PHP file retrieved by Ajax? BTW, the PHP is some PHP and some HTML, etc., the <?PHP and ?> do not encompass all of the code in the file. Right now, it seems as if ALL of the CSS code must be available when the initial page is loaded. This doesn't seem right.
Within the above mentioned <form> I have a list of countries. The "onchange" event on the <select> object is to trigger a javascript function that will lead to an Ajax call to get a list of States, Provinces, etc. when the Country changes. The javascript function, "foo" is in the PHP file that creates the <form>. The error I'm getting says that "foo" is not found, and the error line listed is in my "index.php" file rather than the file that was loaded via Ajax.
Basically, this is the same problem (I think) with my architecture. I really want the content <div> to be CSS'd, and Javascript'able on it's own, isolated as it were.
Keep in mind, all I want to accomplish is a complete site with no refreshes.
If this is not clear, I apologize. I'm happy to clear up anything that is fuzzy.
Thanks in advance,
B.