PDA

View Full Version : Ultimate Fade-in slideshow - relative to root or not?



student101
12-18-2008, 12:20 PM
Ultimate Fade-in slideshow (v1.51)

http://www.dynamicdrive.com/dynamicindex14/fadeinslideshow.htm

Not really a problem as such, it may be a bug; not sure.


- ROOT (http://www.example.com/)
- images (contains images)
- inside images is /thm (contains thumb images)
- includes =>
(contain; banner.php, getpics.php, getpics2.php and random.php)

Inside banner.php;

require_once('random.php');
Inside random.php;

<script type="text/javascript">
var fadeimages=new Array()
</script>
<script src="getpics.php" type="text/javascript"></script>
<script type="text/javascript">
var fadeimages2=new Array() //2nd array</script>
<script src="getpics2.php" type="text/javascript"></script>

The method above wont work,
it has to be like this to work;


- ROOT (http://www.example.com/)
- getpics.php, getpics2.php and random.php in the ROOT
- images (contains images)
- inside images is /thm (contains thumb images)
- includes =>
(contain; banner.php)

jscheuer1
12-18-2008, 05:24 PM
Paths are always in effect for the page that they are on when parsed by the browser. Absolute paths may be used to avoid confusion when a relative path may end up appearing on two or more pages located in different folders, or if the page it will be parsed from isn't clear to the designer.

The only exception I am aware of is the css file, where paths are relative to that file when parsed by the browser, similar to as if it were a page in the above mentioned. However, with certain proprietary IE filters, paths mentioned in relation to them default to the page again, so should always be stated in absolute form, which can also be used for any path in a css file to avoid confusion.

Remember that when writing to a page with javascript or to any file with PHP, the code generated will always be relative to that page/file if javascript is used, and in most if not all cases in PHP as well, not relative to the resource file.

student101
12-18-2008, 05:40 PM
Cool thanks.

Cheers