Link to home
Start Free TrialLog in
Avatar of Lady_M
Lady_MFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Ajax Updater: Where does prototype.js go?

Hi

Somebody told me that protype.js file must go in the same directory as the page that's using it.

Does this mean the same directory as the html page or as the external javascript file that refers to it?

Can somebody clarify the rules please?

Thanks
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

The prototype.js file doesn't need to be in a specific folder in relation to the main page.  Where is the tag that "links" to the file?  The file is an external js file and should be "linked" in the main html page, not in another external js file.

Let me know if you have a question about this.  If you need help with the path to use then let me know the folder structure so I can be specific on the path to use.  The file doesn't need to be in the same folder or any specific folder though.

bol
ASKER CERTIFIED SOLUTION
Avatar of b0lsc0tt
b0lsc0tt
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Lady_M

ASKER

Okay thanks.  So two questions:
does the doctype have to be transitional?  and is it important that the link to the prototype external file comes before the other external js file that will call it?  I presume so.

BTW. on a slightly different but related issue,  I have a window.onload call in the head of my html page which calls the function in my external js file (which then uses the Ajax updater).  IE6 is having none of it.  It doesn't recognise the existance of the external js file it seems.  Any ideas?

Thank you
>> does the doctype have to be transitional?

No.  The code was just to show you what the tags would look like for the external js files if you use prototype and another.  The other html was just to show placement.

>> and is it important that the link to the prototype external file comes before the other external js file that will call it?  <<

It wouldn't matter unless the other external file used something from prototype.js.  You hinted that this may be the case so I listed the prototype file first intentionally.  Depending on the contents of each this may not be an issue at all.  However if one depends on another then the order could be important.  It is best not to have the depend on each other though; the html page or main page is the one that should need the files, not one of the other files.

Where is the line or script with the onload?  Where is the script tag in relation to it?  Make sure the onload is below and script tags calling external js files.  One other caution is when more than one script needs the window.onload line.  They will overwrite each other.  This might be the issue here.  If that is the case then you will need to make a new function that will be called on page load which will call each of the functions.

I hope that helps but if you need more help with the new issue then you should open a new question.  If you do please post the URL here so I can look at it too.  I might have more to contribute.

Let me know if you have a question about any of the comments for this issue.  I'll be happy to provide whatever I can.

bol
Avatar of Lady_M

ASKER

Hi, thanks for that.  I think I understand the prototype now at least.

Re the other problem, I've been discussing it here: https://www.experts-exchange.com/questions/22863334/Functions-stopped-working-in-IE6.html
The url in that thread has been updated numerous times now though so won't be strictly relevant to it.  But any help would be much appreciated.  Thanks again.
Your welcome!  I'm glad I could help.  Thanks for the fun question, the grade and the points.  I'll look at the other question and post if I can help/contribute.

bol