sandbudd Posted March 28, 2009 Share Posted March 28, 2009 I have a php file that has javascript for a scrolling banner. It works fine on its own but when I implement it on a page with include_once "" it shows up does not scroll? any suggestions? Link to comment https://forums.phpfreaks.com/topic/151553-solved-external-file-not-working/ Share on other sites More sharing options...
jackpf Posted March 28, 2009 Share Posted March 28, 2009 You could be using some relative references maybe? Link to comment https://forums.phpfreaks.com/topic/151553-solved-external-file-not-working/#findComment-795970 Share on other sites More sharing options...
sandbudd Posted March 28, 2009 Author Share Posted March 28, 2009 such as? please explain Link to comment https://forums.phpfreaks.com/topic/151553-solved-external-file-not-working/#findComment-795972 Share on other sites More sharing options...
jackpf Posted March 28, 2009 Share Posted March 28, 2009 For example, if you have a file structure like so: index.php -> javascript.js another_javascript.js If calling the javascript.js directly, and the javascript.js script references another_javascript.js as src="another_javascript.js", it'll work. But if you're including it from the root and using this method rather than src="http://www.example.com/dir/another_javascript.com", when including the javascript.js, it'll be looking for another_javascript.js in the wrong directory. It's kind of hard to explain. So yeah, are you calling any other files or anything, or are you getting an error? Link to comment https://forums.phpfreaks.com/topic/151553-solved-external-file-not-working/#findComment-795980 Share on other sites More sharing options...
sandbudd Posted March 28, 2009 Author Share Posted March 28, 2009 no not at all....I have the javascript in a external php file that calls nothing...then I am calling the php file.. It shows up but does not scroll.. if I put at the top of the page and call it it does scroll but not where I want it to? Link to comment https://forums.phpfreaks.com/topic/151553-solved-external-file-not-working/#findComment-795993 Share on other sites More sharing options...
sandbudd Posted March 28, 2009 Author Share Posted March 28, 2009 when I say up top I mean first line <?php include_once "scroll.php" ?> that works putting the scrolling banner up top of page Link to comment https://forums.phpfreaks.com/topic/151553-solved-external-file-not-working/#findComment-795994 Share on other sites More sharing options...
jackpf Posted March 28, 2009 Share Posted March 28, 2009 And you don't get any javascript errors? Link to comment https://forums.phpfreaks.com/topic/151553-solved-external-file-not-working/#findComment-795996 Share on other sites More sharing options...
sandbudd Posted March 28, 2009 Author Share Posted March 28, 2009 no none Link to comment https://forums.phpfreaks.com/topic/151553-solved-external-file-not-working/#findComment-795997 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.