Jump to content

[SOLVED] I'm Going INSANE!!!!!!!!


seventheyejosh

Recommended Posts

can some one please, please tell me why

 

<script type="text/javascript" src="/templates/admin/js/toggle.js"></script>

 

will work perfectly fine, but

 

<script type="text/javascript" src="/js/toggle.js"></script>

 

will not work period!?????

 

I am going freaking nuts. And im not a nOOb, i just cant figure it out to save my life!

 

MANY MANY thanks in advance.

Link to comment
Share on other sites

if i put the file in

/templates/admin/js/toggle.js

 

and put in the

 

<script type="text/javascript" src="/templates/admin/js/toggle.js"></script>

 

it works beautifully, but if i put it in

 

/js/toggle.js

 

with

 

<script type="text/javascript" src="/js/toggle.js"></script>

 

it doesnt work.

 

the folders both have the same perms and everything

Link to comment
Share on other sites

it starts saying my functions are undefined, etc, as if the file isnt accessible or something.

 

basically i'm dynamically reading the directory of js/ in public_html, and putting all .js files into the header.

 

it works just fine reading from the js folder in the admin template, but not in the js folder

 

public_html/templates/admin/toggle.js = :)

 

public_html/js/toggle.js = :(

 

even though both will show up in the page source just fine

Link to comment
Share on other sites

corbin was asking what errors do you get if you go to the file directly. I believe he means if you go to the JS file directly, i.e. "www.yourdomain.com/js/toggle.js"? Is the file found by the browser?It should attempt to download it.

 

Could be a caching issue where it has "remembered" the location of the fine and can't find it any more. Try pressing Ctrl-F5 while on the html page.

 

however, I did not ice in your last post you put this:

public_html/templates/admin/toggle.js = :)

That's not the same as "/templates/admin/js/toggle.js". Typo?

 

Also, what is the path to the HTML file that is loading the JS file? And, i will admit I have had similar bouts of frustration and found the problem was just a bonehead issue on my part such as I was editing my local copy of the HTML page and had moved the JS file on my live server.

Link to comment
Share on other sites

Yea it was a typo :)

 

I actually managed to find the error early this morning.

 

In my htaccess, i forgot to add the rule for the folders to make them accessible.

 

I had:

 

RewriteCond %{REQUEST_URI} "/modules/"

 

so /modules/admin/js/toggle.js was accessible

 

but forgot to add

 

RewriteCond %{REQUEST_URI} "/js/" [OR]

RewriteCond %{REQUEST_URI} "/includes/"

 

so neither /includes/js/toggle.js

 

or /js/toggle.js

 

were accessible.

 

so i was able to see my scripts up there, but couldnt access them. :)

 

i actually figured it out when my flv files werent accessible from /includes/video/, but were accessible in /modules/main/video/

 

thanks for all your help though :) and sorry to post in the javascript forum, i honestly thought thats what the error was.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.