We help IT Professionals succeed at work.

Ajax Updater: Where does prototype.js go?

Lady_M asked
Last Modified: 2008-01-09

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?

Watch Question

b0lsc0ttIT Manager

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.

IT Manager
Unlock this solution and get a sample of our free trial.
(No credit card required)


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
b0lsc0ttIT Manager

>> 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.



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/Software/Internet_Email/Web_Browsers/Q_22863334.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.
b0lsc0ttIT Manager

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.


Gain unlimited access to on-demand training courses with an Experts Exchange subscription.

Get Access
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Empower Your Career
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a sample view!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.


Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.