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

  • SEARCH
  • Home
  • 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 7948701
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T01:47:53+00:00 2026-06-04T01:47:53+00:00

Having a bit of trouble getting jQuery and Prototype working together. The error console

  • 0

Having a bit of trouble getting jQuery and Prototype working together.
The error console is throwing an error

$(divid).visible is not a function

My old prototype was three variations on

function toggleDisplayWait(divId, imgId, durationmSec) {
    if(!$(divId).visible()) 
            {
                move = Effect.BlindDown;
                newImage = "./img/minus.png";
            }
            else {
                move = Effect.BlindUp;
                newImage = "./img/plus.png";  
            }        
            move(divId, {duration: durationmSec / 1000.0 });
            setTimeout(function() { $(imgId).src = newImage; }, durationmSec)
        }

And my new jQuery I found in a tutorial is

// Init the form once the document is ready
jQuery( init );


// Initialize the form

function init() {

  // Hide the form initially.
  // Make submitForm() the forms submit handler.
  // Position the form so it sits in the centre of the browser window.
  jQuery('#contactForm').hide().submit( submitForm ).addClass( 'positioned' );

  // When the "Send us an email" link is clicked:
  // 1. Fade the content out
  // 2. Display the form
  // 3. Move focus to the first field
  // 4. Prevent the link being followed

  jQuery('a[href="#contactForm"]').click( function() {
    jQuery('#content').fadeTo( 'slow', .2 );
    jQuery('#contactForm').fadeIn( 'slow', function() {
      jQuery('#senderName').focus();
    } )

    return false;
  } );

  // When the "Cancel" button is clicked, close the form
  jQuery('#cancel').click( function() {
    jQuery('#contactForm').fadeOut();
    jQuery('#content').fadeTo( 'slow', 1 );
  } ); 

  // When the "Escape" key is pressed, close the form
  jQuery('#contactForm').keydown( function( event ) {
    if ( event.which == 27 ) {
      jQuery('#contactForm').fadeOut();
      jQuery('#content').fadeTo( 'slow', 1 );
    }
  } );

}



// Submit the form via Ajax

function submitForm() {
  var contactForm = jQuery(this);

  // Are all the fields filled in?

  if ( !jQuery('#senderName').val() || !jQuery('#senderEmail').val() || !jQuery('#message').val() ) {

    // No; display a warning message and return to the form
    jQuery('#incompleteMessage').fadeIn().delay(messageDelay).fadeOut();
    contactForm.fadeOut().delay(messageDelay).fadeIn();

  } else {

    // Yes; submit the form to the PHP script via Ajax

    jQuery('#sendingMessage').fadeIn();
    contactForm.fadeOut();

    jQuery.ajax( {
      url: contactForm.attr( 'action' ) + "?ajax=true",
      type: contactForm.attr( 'method' ),
      data: contactForm.serialize(),
      success: submitFinished
    } );
  }

  // Prevent the default form submission occurring
  return false;
}

// Handle the Ajax response

function submitFinished( response ) {
  response = jQuery.trim( response );
  jQuery('#sendingMessage').fadeOut();

  if ( response == "success" ) {

    // Form submitted successfully:
    // 1. Display the success message
    // 2. Clear the form fields
    // 3. Fade the content back in

    jQuery('#successMessage').fadeIn().delay(messageDelay).fadeOut();
    jQuery('#senderName').val( "" );
    jQuery('#senderEmail').val( "" );
    jQuery('#message').val( "" );

    jQuery('#content').delay(messageDelay+500).fadeTo( 'slow', 1 );

  } else {

    // Form submission failed: Display the failure message,
    // then redisplay the form
    jQuery('#failureMessage').fadeIn().delay(messageDelay).fadeOut();
    jQuery('#contactForm').delay(messageDelay+500).fadeIn();
  }
}

I used the no conflict, and changed my $ for jQuery, but no joy. The start of the script is

<script src="java/prototype.js" type="text/javascript"></script>
<script src="java/scriptaculous.js" type="text/javascript"></script>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
<script> jQuery.noConflict() </script>
<script type="text/javascript"> var messageDelay = 3000;  // How long to display status messages (in milliseconds) </script>
<script type="text/javascript" language="javascript">   
  • 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. Editorial Team
    Editorial Team
    2026-06-04T01:47:54+00:00Added an answer on June 4, 2026 at 1:47 am

    Found the answer here after a good bit of searching
    – scriptaculous and JQuery do not collaborate

    I loaded the jQuery library first,
    then the no conflict,
    then the other libraries as suggested

    The changes looked like

        <script type="text/javascript" src="http://code.jquery.com/jquery-latest.js"></script><script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js"></script>
        <script> jQuery.noConflict() </script>
        <script type="text/javascript"> var messageDelay = 3000;  // How long to display status messages (in milliseconds) </script>
        <script src="java/prototype.js" type="text/javascript"></script>
        <script src="java/scriptaculous.js" type="text/javascript"></script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm currently working with PowerPoint in VB.NET and having a bit of trouble getting
I'm having a tad bit of trouble getting the jQuery Form Plugin to work
I'm having trouble getting jQuery to allow only one content-DIV to be visible at
I am having trouble getting a success: function(){} working - the ajax code I
I'm having a bit of trouble with getting an editable block of text working
I'm having a bit of trouble getting the desired functionality from my function... Basically,
I'm having a bit of trouble getting some final bit of code working to
Im having a bit of trouble getting my JSON to be recognised by my
I'm having a bit of trouble getting my program to read in data from
I'm having a bit of trouble getting my form validation to work. As of

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.