xcandiottix Posted November 25, 2010 Share Posted November 25, 2010 I have a javascript page included with in a div on a second page. The 1 page has this code: <html> <script type="text/JavaScript"> <!-- document.write("Hello World!") //--> </script> </html> If i navigate directly to the first page i get "Hello world" but if i navigate to the page with the div the includes the first page I get nothing. Does the div preclude the script from running? On the second page, if i view source I don't see the above js code. Is there a way to make it work? Quote Link to comment https://forums.phpfreaks.com/topic/219783-complicated-problem/ Share on other sites More sharing options...
trq Posted November 25, 2010 Share Posted November 25, 2010 On the second page, if i view source I don't see the above js code. Is there a way to make it work? Then it is not being included. Quote Link to comment https://forums.phpfreaks.com/topic/219783-complicated-problem/#findComment-1139373 Share on other sites More sharing options...
xcandiottix Posted November 25, 2010 Author Share Posted November 25, 2010 Well here's where it gets complicated. On the first page i have: <html> <script type="text/JavaScript"> <!-- document.write("Hello World!") //--> </script> </html> <?php echo "Goodbye World";?> Again, navigating directly to the first page gets both printed on screen. But if I navigate to the second page I get: Goodbye World. I don't understand how it can run the php, html, and css that are actually on the first page but not the js. On the second page, here's the part of the page that gets the first page's address from the xml file else{ var element = document.getElementById("app1"); req.open('GET', application1, false); req.send(null); element.innerHTML = req.responseText; } and here's how page one is brought up on the second page document.write("<td width='33%' class='LEFTappcell' align='center' valign='top'><div id='tit1'></div><br><div id='app1'></div></td>"); Quote Link to comment https://forums.phpfreaks.com/topic/219783-complicated-problem/#findComment-1139375 Share on other sites More sharing options...
trq Posted November 25, 2010 Share Posted November 25, 2010 You understand that a html page can only have 1 set of <head></head> tags? Quote Link to comment https://forums.phpfreaks.com/topic/219783-complicated-problem/#findComment-1139443 Share on other sites More sharing options...
haku Posted November 25, 2010 Share Posted November 25, 2010 And <html> tags. Poorly formed HTML is most likely your issue. Anyways, post the HTML output here for more specific help. These kinds of issues are quite easy to point out when you can see the HTML that is causing them. Quote Link to comment https://forums.phpfreaks.com/topic/219783-complicated-problem/#findComment-1139480 Share on other sites More sharing options...
xcandiottix Posted November 26, 2010 Author Share Posted November 26, 2010 Well, i think you post made good points and honestly I was so focused on the individual pages tat I lost sight of where all the includes were landing. Here's the source code from the browser. Strangely in Chrome, where ever there's javascript it's in plain text .... not color coded like the HTML, CSS, etc. Is it possible that: <script type="text/javascript"> Is wrong? The page loads like so: http://www.appdilly.com/member/user_page.php -Includes in order: -/Appdilly-Logo-and-Banner-User-UP.html (an html banner with js mouse over) -/css_eval.php (dynamically generated css) -/evaluator.php (this is where the problem is) --Requests data from Kcandiotti400.xml --Kcandiotti400.xml has an element with the address for --"/applications/appfiles/3.php?u=Kcandiotti400" --/3.php (evaluator includes this page with in one of evalulator's DIV tags) --3.php includes index.php, index.php's JS does not display. -/Mlowernavbar.html (html nav bar) -/copyright.html (copyright info) I've attached the source for userpage.php evalulator.php 3.php index.php And links to the corresponding live pages: http://www.appdilly.com/member/user_page.php?u=Kcandiotti400 http://appdilly.com/applications/appfiles/3.php http://appdilly.com/applications/includes/3/index.php As you can see the JS works on the last two but not when the entire package is included on the main page. Thanks so much! [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/219783-complicated-problem/#findComment-1139824 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.