Directory Root URL
Posted: Tue Oct 06, 2009 10:19 pm
Hello! I'm trying out jQuery for the first time. I downloaded the file and save it in my javascripts folder of my website (htdocs/tuklass/javascripts). I'm using Dreamweaver. My problem is how to use the src attribute of the script tag. I don't know why I had inconsistency problems with this.
My document root is htdocs. In one of my pages, add_class.php (in htdocs/tuklass/classes), I placed this code:
<script type='text/javascript' src='../tuklass/javascripts/form.js' ></script>
I know that "../" means the document root. This page works. But in my exam_prac.php (in htdocs/tuklass/exams), this code:
<script type="text/javascript" src="../tuklass/javascripts/jquery-1.3.2.min.js" ></script>
doesn't work at all! When I use the autofill feature of dreamweaver, it tells me to write "../javascripts/jquery-1.3.2.min.js", saying that "../" or the document root is htdocs/tuklass. After changing it, the code works. Please help me! I'm really confused.
Thanks in advance!
My document root is htdocs. In one of my pages, add_class.php (in htdocs/tuklass/classes), I placed this code:
<script type='text/javascript' src='../tuklass/javascripts/form.js' ></script>
I know that "../" means the document root. This page works. But in my exam_prac.php (in htdocs/tuklass/exams), this code:
<script type="text/javascript" src="../tuklass/javascripts/jquery-1.3.2.min.js" ></script>
doesn't work at all! When I use the autofill feature of dreamweaver, it tells me to write "../javascripts/jquery-1.3.2.min.js", saying that "../" or the document root is htdocs/tuklass. After changing it, the code works. Please help me! I'm really confused.
Thanks in advance!