Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 109043
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T02:00:26+00:00 2026-05-11T02:00:26+00:00

I know very little about JavaScript but despite this I’m trying to cobble something

  • 0

I know very little about JavaScript but despite this I’m trying to cobble something together on my wordpress blog. It’s not working, and I don’t know how to resolve it, and hey, that’s what StackOverflow is for, right?

Firstly, the error message is:

Error: element.dispatchEvent is not a function Source File: http://.../wp-includes/js/prototype.js?ver=1.6 Line: 3936 

It happens on page load. My page load handler is registered thusly:

Event.observe(window, 'load', show_dates_as_local_time); 

The error goes away if I disable some other plugins, and this (plus googling) led me to conclude that it was a conflict between prototype and jQuery (which is used by some of the other plugins).

Secondly I’m following the wordpress recommended practice of using wp_enqeue_script to add a dependency from my JavaScript to the Prototype library, as follows:

add_action( 'wp_print_scripts', 'depo_theme_add_javascript' );  function depo_theme_add_javascript() {     wp_enqueue_script('friendly_dates', 'javascript/friendly_dates.js', array('prototype')); } 

Now I’m also aware that there are some potential conflicts between jQuery and Prototype which are resolved using the jQuery noConflicts method. I’ve tried calling that from various places but no good. I don’t think this is the problem because a) the noConflict function relates solely to the $ variable, which doesn’t seem to be the problem here, and b) I would expect wordpress to sort it out for me because it can…

Lastly, using the Venkman debugger I’ve determined that the element referenced in the error message is indeed an HTMLDocument but also does lack a dispatchEvent. Not sure how this could happen, given it’s a standard DOM method?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T02:00:27+00:00Added an answer on May 11, 2026 at 2:00 am

    Thanks for the suggestions all. In the end I think Kent’s explanation was the closest, which basically amounted to ‘Prototype is broken’. (Sorry if I’m summarizing you incorrectly 🙂

    As for the jQuery.noConflict option – I already mentioned this in the question. It makes a difference when you run this method, and I have very little control over that. As I said, I have tried running it in a couple of different places (specifically the page header and also from my script file), to no effect. So, much as we’d all like it to be, ‘just use noConflict‘ is not an answer to this question, at least not without additional information.

    Besides, jQuery.noConflict seems to be about the $ variable, and the code around the error point does not deal with that variable at all. Of course they could be related indirectly, I haven’t tracked it down.

    So basically I ended up rewriting the script using jQuery instead of Prototype, which actually had its own problems. Anyway I’ve published the whole war story on my blog, should you be interested.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 61k
  • Answers 61k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer You'll need to package your application up in a CAB… May 11, 2026 at 9:47 am
  • added an answer Some of my workmates are working on Ironclad, a project… May 11, 2026 at 9:47 am
  • added an answer This is not an error page but a standard PHP… May 11, 2026 at 9:47 am

Related Questions

I know very little about JavaScript but despite this I'm trying to cobble something
First question on here so please be nice :) I know very little about
I just started thinking about creating/customizing a web crawler today, and know very little
Im new to programming and I dont know very much about but I'm making
I'm planning to write an operating system and I don't know very much about
I know this maybe a very basic question but I'm having a bit of
I know that accessing and manipulating the DOM can be very costly, so I
I know this is a darn simple question, but I'm very used to using
Warning - I am very new to NHibernate. I know this question seems simple
Very basic question: how do I write a short literal in C++? I know

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.