Error: The object does not have a method called 'to top scroller' and it is causing an uncaught type error

A plugin was obtained from the following link: http://www.jqueryscript.net/other/jQuery-Plugin-For-Smooth-Scroll-To-Top-Bottom-scrollToTop.html.i and the code was attached below in the index.html file. Several jQuery plugins were attempted, but none worked for me.

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=0" />
    <title>Pharmaceutical</title>
    <link rel="shortcut icon" type="image/x-icon" href="css/images/favi.png" />
    <link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
    <link href='http://fonts.googleapis.com/css?family=Raleway:400,900,800,700,600,500,300,200,100' rel='stylesheet' type='text/css'>
    <link href="http://www.jqueryscript.net/css/jquerysctipttop.css" rel="stylesheet"  type="text/css">
    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="js/jquery.totop.js" type="text/javascript"></script>
    <script src="js/jquery-1.8.0.min.js" type="text/javascript"></script>
    <!--[if lt IE 9]>
    <script src="js/modernizr.custom.js"></script>
    <![endif]-->

     <script type="text/javascript" src="jquery.js"></script>
    <script src="js/jquery.carouFredSel-5.5.0-packed.js" type="text/javascript"></script>
    <script src="js/functions.js" type="text/javascript"></script>
</head>  
<body>
<!-- wrapper -->
 <div id="wrapper">
    <!-- shell -->
    <div class="shell">

    <!-- container -->
    <div class="container">

        <!-- header -->
        <header id="header">
            <h1 id="logo"><a href="#">Retina</a></h1>
            <!-- search -->
            <div class="search">
                <form action="" method="post">
                    <input type="text" class="field" value="keywords here ..." title="keywords here ..." />
                    <input type="submit" class="search-btn" value="" />
                    <div class="cl">&nbsp;</div>
                </form>
            </div>
            <!-- end of search -->
            <div class="cl">&nbsp;</div>
        </header>
        <!-- end of header -->
        <!-- navigaation -->
        <div id="menu">
         <ul class="menu">
         <li><a href="#" class="parent"><span>Home</span></a>
        <div><ul>
        <li><a href="#"><span>About us</span></a></li>
            <li><a href="#" class="parent"><span>History</span></a>
      
                  ...

Answer №1

This particular error arises from the plugin not being initialized properly. Make sure to initialize the plugin before jQuery:

<script src="js/jquery.totop.js" type="text/javascript"></script>
<script src="js/jquery-1.8.0.min.js" type="text/javascript"></script>

To fix this, rearrange the order like this:

<script src="js/jquery-1.8.0.min.js" type="text/javascript"></script>    
<script src="js/jquery.totop.js" type="text/javascript"></script>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Unraveling JSON data retrieved from a MySQL query

After successfully encoding a MySQL result from PHP into JSON, I am now faced with the task of decoding it using JavaScript. Let's assume that my string returned is: [{"0":"x","1":"z"},{"0":"xs","1":"zz"}] I would appreciate some guidance on how to ...

I have a json file that I need to convert to a csv format

I am currently working with a json file, but I need to switch it out for a csv file. Do I have to use a specific library to accomplish this task, or can I simply modify the jQuery 'get' request from json to csv? I attempted the latter approach, b ...

The byte order of integer literals in JavaScript

When writing the following line in Javascript: var n = 0x1234, is it always true that n == 4660? This question could also be phrased as follows: Does 0x1234 represent a series of bytes with 0x12 as the first byte and 0x34 as the last byte? Or does 0x1234 r ...

Creating a hierarchical tree visualization with React JS using JSON data

As a newcomer to React JS, I've been working on a project for the past three days and need some help. My task is to create a category list structured like this: Category1 ->Sub-Category1 ->Sub-Category2 Category2 Category3 . . . CategoryN I h ...

Tips on adding to Jquery html code while maintaining the current CSS styling

My JavaScript function looks like this: function appendAllQna(qnaList, num){ for (var i in qnaList){ var qnaCom = ""; qnaCom += "<div class='scomment scommentLine'>"; if(qnaList[i].sellerYn == "Y"){ ...

Handling large file uploads with Ajax in MVC 4.0 when Request.Files is empty

I attempted to incorporate a basic file upload feature with ajax and progress bar into my mvc 4.0 controller using VS2013 and .net Framework 4.5. Uploads under 4MB function correctly, but when attempting to upload files larger than 4MB, the Controller met ...

What could be causing the HTML content to not display when the code is executed?

I've recently started using Visual Studio Code for my project. I am able to build my code without any errors, but when I run it, the HTML content does not display properly - only the CSS styling for the header and footer is visible. I have tried click ...

Using Node.js buffers in typed arrays

Within my node.js application, I am working with a Buffer that was stored as a blob in MySQL and retrieved using sequelize. This Buffer is composed of 16-bit integers, and in the past, I have parsed it using a for loop. var spectrum_buffer = spectrums ...

Tips for sending information to a child component from a parent in Vue.js

Is there a way to pass the image url to this vue component? I am moving the code to a separate php file that will contain the <script> tag used by Vue, but it seems like it won't recognize the passed data from a parent component. Vue.component( ...

Exploring the power of CSS grid in React/Gatsby for creating dynamic layouts with varying numbers of columns in each

I need help creating a dynamic grid layout where the number of columns alternates between rows. For example, I want the first row to have one column, the second row to have two columns, and so on. Right now, my grid only has two columns per row. Does anyon ...

Pass a byte array from the back-end code to an AJAX request

I have a web method where I am converting HTML to PDF and saving it to a local folder. The goal is for the user to download the file without needing to reload the page. To achieve this, I am attempting to make an AJAX POST call to the web method to retriev ...

What steps should be taken to rectify open tags or quotes in the source code of CKeditor when a user forgets

When inserting data into MySQL using CKEditor and PHP, I encounter an issue when users input raw HTML containing open quotes or tags. How can I handle this problem? For instance, if a user enters content in the CKEditor source and leaves quotes open, how ...

PHP form submission upon conditions being satisfied

I am not utilizing Javascript as it is disabled in my current environment. Here is the code that I would like you to review. I am attempting to use PHP to replicate the functionality of Javascript or jQuery's simple : document.form2.submit() <div ...

Modify anchor link color in a one-page website by using Jquery to detect scroll position changes when reaching different page sections

Each if statement contains specific numbers to change the text color of the visited/current/active anchor link. The height of the page is dependent on its width. How can this be resolved? Apologies if my explanation is confusing, English isn't my stro ...

What could be causing my mongoose array to remain empty without any values being stored in it?

Issue at Hand While I have come across several similar problems on Stack Overflow about this particular issue, none of the solutions provided seemed to work for me. I am in the process of developing a basic Forum application with two routes - one for cre ...

Adjust the background of the input range style prior to the thumb icon

Is there a way to style the bar before the thumb with a different color on a range input? I have been searching for a solution without much success. This is the desired look: https://i.sstatic.net/ZkTAB.png Unfortunately, Chrome no longer supports input[t ...

What is preventing array.map() from being a function?

I am facing an issue when trying to map an array from the useState hook in react. The error message that I am getting is: TypeError: documents.map is not a function Here is the code snippet that I am working with: const [docs, setDocs] = useState(docume ...

Utilizing a switch statement for form validation

Currently, I am in the process of creating a form validation that involves two conditions for validation. I'm considering using a combination of switch case and if else statements. Would this be an appropriate approach or is it generally discouraged? ...

Is there a way to define a specific browser for executing GWT tests?

In my GWT project, I am utilizing the HTML5 canvas feature. During testing, I rely on GWTTestCase to ensure application functionality. Some functions are only supported in Firefox starting from gecko 1.9. However, while testing with Firefox 3.0.1, err ...

Transitioning NodeJS from local development to a live website

After successfully creating a site using NodeJS with one-page HTML/jQuery, everything is functioning properly on localhost. However, I am facing issues when trying to put the site online at www.xxxx.com. I already have a registered .com domain, but I am un ...