toolman Posted July 31, 2012 Share Posted July 31, 2012 Hi, When I add the following javascript, my page stops loading. I have tried adding it to various places in my page, but it doesn't seem to make a difference. <script type="text/javascript"> jQuery(document).ready(function() { $('#parallax .parallax-layer') .parallax({ mouseport: $('#parallax') }); }); </script> Any ideas? Link to comment https://forums.phpfreaks.com/topic/266491-javascript-stopping-page-loading/ Share on other sites More sharing options...
trq Posted July 31, 2012 Share Posted July 31, 2012 What do firebug or developer tools have to say? Link to comment https://forums.phpfreaks.com/topic/266491-javascript-stopping-page-loading/#findComment-1365645 Share on other sites More sharing options...
toolman Posted July 31, 2012 Author Share Posted July 31, 2012 Hi, I can't seem to get anything from firebug as the page just loads blank when I use that code Link to comment https://forums.phpfreaks.com/topic/266491-javascript-stopping-page-loading/#findComment-1365685 Share on other sites More sharing options...
Jessica Posted July 31, 2012 Share Posted July 31, 2012 This is in a PHP file? Did you END the ?> php tag?? Do you have error reporting on and set to E_ALL? Link to comment https://forums.phpfreaks.com/topic/266491-javascript-stopping-page-loading/#findComment-1365686 Share on other sites More sharing options...
toolman Posted July 31, 2012 Author Share Posted July 31, 2012 Its is a .tpl file, but it just seems to be that part of the code that is stopping the page working. Its a jQuery parallax script. Link to comment https://forums.phpfreaks.com/topic/266491-javascript-stopping-page-loading/#findComment-1365691 Share on other sites More sharing options...
Christian F. Posted July 31, 2012 Share Posted July 31, 2012 Check the error log on the server, should tell you why this is happening. I suspect jesirose is right on the money, btw. Link to comment https://forums.phpfreaks.com/topic/266491-javascript-stopping-page-loading/#findComment-1365703 Share on other sites More sharing options...
Jessica Posted July 31, 2012 Share Posted July 31, 2012 If it's a .tpl you likely need to wrap that section in {literal} tags or whatever is the equivalent for your template engine. Link to comment https://forums.phpfreaks.com/topic/266491-javascript-stopping-page-loading/#findComment-1365708 Share on other sites More sharing options...
toolman Posted July 31, 2012 Author Share Posted July 31, 2012 Many thanks! - it was the {literal} tag that fixed it. Link to comment https://forums.phpfreaks.com/topic/266491-javascript-stopping-page-loading/#findComment-1365711 Share on other sites More sharing options...
Jessica Posted July 31, 2012 Share Posted July 31, 2012 This is why you need to ask clear questions. In your original post you said it was PHP code, which it's not, it's HTML/Javascript, and it's on a .tpl! If you had said from the beginning it was on a tpl (I assume it's Smarty, but I don't know if any other engines use .tpl) this thread would be much shorter. Link to comment https://forums.phpfreaks.com/topic/266491-javascript-stopping-page-loading/#findComment-1365714 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.