• I just noticed that prototype.js is included in every page. It is 70k and takes some time to download (for new visitors). Is it really necessary to include this on every page? Is it used?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Prototype is not included on every page unless you have a theme or plugin that is including it or something else that depends on it. It is included on all the admin pages, mind you, because almost all of them use it in some fashion.

    Post a link to your site, so we can see what’s going on for ourselves.

    Thread Starter lborgman

    (@lborgman)

    Thanks Otto42, I thought it was something in my theme. I built that theme without looking very carefully at the bottom plates for it. However I switched to WordPress Default 1.6 to see if that theme also loaded it. To my surprise it did.

    Could it be some plugin I am using that needs it? I am currently using

    – Akismet
    – Automoderate comments
    – Comments Post Rewriter
    – Simple Tags
    – Text Control
    – WordPress Hashcash
    – wp-cache

    I also have

    – Bad Behaviour
    – Challenge
    – Hello Dolly
    – Simple CPR Log Reader

    installed, but they are not activated.

    It looks to me however as a bug, since there are no JavaScript at all used on my pages (except when commenting or doing administration).

    My site is here (in Swedish): http://OurComments.org/blog/

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    The Comments Post Rewriter plugin uses extensive amounts of javascript, and it appears to be using prototype in some places. The most notable place is on single post pages, it’s directly using Event and the ${} trick, both of which are parts of prototype.js.

    Looking through your pages, you have lots and lots of javascript. You probably don’t know about it, because it’s all added by plugins (near as I can see).

    Thread Starter lborgman

    (@lborgman)

    Otto42: Ah, thanks, I did not notice. I never tried to see how it was implemented. I expected something using just “onsubmit”.

    Maybe some day I should take some time to learn to read this kind of Javascript. It is quite impressive. How does it come that you so easily recognized Event?

    But what is the ${} trick?

    Moderator Samuel Wood (Otto)

    (@otto42)

    WordPress.org Admin

    Maybe some day I should take some time to learn to read this kind of Javascript. It is quite impressive. How does it come that you so easily recognized Event?

    I did a lot of reading on the Prototype JS framework a while back. http://prototypejs.org

    But what is the ${} trick?

    One of prototypes very handy utility bits. $(‘someid’) returns the contents of the element on the page with an id of ‘someid’.

    Thread Starter lborgman

    (@lborgman)

    Thanks Otto42.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Is it necessary to always include prototype.js?’ is closed to new replies.