adam84 Posted March 3, 2007 Share Posted March 3, 2007 My index page loads both of my JS scripts(ajax.js,functions.js). In that page,I have a table with 3 frame, left,center and right. The center frame's td tag hold a <DIV> tag. The are a list links in the right frame. When the user clicks a link (right frame), ajax loads the page in the center <DIV> tag. In the page that was loaded by the ajax, i have a button and when the button is clicked it called a javascript function located in my JS script file. For some reason, it doesnt seem to link to the JS script files. It always says 'object expected', when I click the button. Once I include my JS file into the main page that is always loaded(index page), wiil I have to include the JS file in any of the page that ajax calls? Or since I already included the JS file already, do I have to include it into the page that the ajax loaded? index page <? echo "<HTML>\n"; echo "<HEAD>\n"; echo "<TITLE>The Angry Dragon</TITLE>\n"; echo "<script src=\"jsFunctions.js\" language=\"javascript\" type=\"text/javascript\"></script>\n"; echo "<script src=\"ajax.js\" language=\"javascript\" type=\"text/javascript\"></script>\n"; echo "</HEAD>\n"; echo "<BODY BGCOLOR=\"#FFFFFF\" onLoad=javascript:mainOnLoad();>\n"; echo "<CENTER>\n"; echo "<FONT COLOR=\"#000000\"><H1></H1></FONT>\n"; echo "<TABLE WIDTH=85% BORDER=1>\n"; echo "<TR>\n"; echo "<TD WIDTH=20% VALIGN=TOP><TABLE BORDER=1 WIDTH=100%><TR><TD WIDTH=100% VALIGN=TOP><DIV NAME=leftFrame ID=leftFrame></DIV><TD></TR></TABLE></TD>\n"; echo "<TD WIDTH=60% VALIGN=TOP><TABLE BORDER=1 WIDTH=100%><TR><TD WIDTH=100% VALIGN=TOP><DIV NAME=centerFrame ID=centerFrame></DIV><TD></TR></TABLE></TD>\n"; echo "<TD WIDTH=20% VALIGN=TOP><TABLE BORDER=1 WIDTH=100%><TR><TD WIDTH=100% VALIGN=TOP><DIV NAME=rightFrame ID=rightFrame></DIV><TD></TR></TABLE></TD>\n"; echo "</TR>\n"; echo "</TABLE>\n"; echo "<CENTER>\n"; echo "</BODY>\n"; echo "</HTML>\n"; ?> Part of the page that gets loaded echo "<TR>"; echo "<TD VALIGN=MIDDLE ALIGN=CENTER COLSPAN=2>"; echo "<INPUT TYPE=BUTTON NAME=SEARCH ID=SEARCH VALUE='Search' ONCLICK=javascript:archivedSearch();>"; echo "</TD>"; echo "</TR>"; Any ideas? On what I can do? Quote Link to comment Share on other sites More sharing options...
Greaser9780 Posted March 4, 2007 Share Posted March 4, 2007 I'm not a huge AJAX guy I just started learning. One thing I know from PHP though, I don't even see a need for you to be using php to show any of that. Why not just use html? <HTML> <HEAD> <TITLE>The Angry Dragon</TITLE> <script src="jsFunctions.js" language="javascript" type="text/javascript"></script> <script src="ajax.js" language="javascript" type="text/javascript"></script> </HEAD> <BODY BGCOLOR="#FFFFFF" onLoad="javascript:mainOnLoad();"> <CENTER> <FONT COLOR="#000000"><H1></H1></FONT> <TABLE WIDTH=85% BORDER=1> <TR> <TD WIDTH=20% VALIGN=TOP><TABLE BORDER=1 WIDTH=100%><TR><TD WIDTH=100% VALIGN=TOP><DIV NAME=leftFrame ID=leftFrame></DIV><TD></TR></TABLE></TD> <TD WIDTH=60% VALIGN=TOP><TABLE BORDER=1 WIDTH=100%><TR><TD WIDTH=100% VALIGN=TOP><DIV NAME=centerFrame ID=centerFrame></DIV><TD></TR></TABLE></TD> <TD WIDTH=20% VALIGN=TOP><TABLE BORDER=1 WIDTH=100%><TR><TD WIDTH=100% VALIGN=TOP><DIV NAME=rightFrame ID=rightFrame></DIV><TD></TR></TABLE></TD> </TR> </TABLE> <CENTER> </BODY> </HTML> Add to that all of the table and td declarations should be in "" Quote Link to comment Share on other sites More sharing options...
WebGeek182 Posted March 14, 2007 Share Posted March 14, 2007 Question: Are you wanting to make the page dynamic on the server side? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.