close

[Solved] “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project in javascript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project Error Occurs?

Today I get the following error “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project in javascript.

How To Solve “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project Error ?

  1. How To Solve “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project Error ?

    To Solve “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project Error I'm using jQuery 3.3.1 and I received the same error, in my case, the URL was an Object vs a string.

  2. “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project

    To Solve “Uncaught TypeError: a.indexOf is not a function” error when opening new foundation project Error I'm using jQuery 3.3.1 and I received the same error, in my case, the URL was an Object vs a string.

Solution 1

Please add below jQuery Migrate Plugin

<script src="https://code.jquery.com/jquery-3.3.1.min.js"></script>
<script src="https://code.jquery.com/jquery-migrate-1.4.1.min.js"></script>

Solution 2

I’m using jQuery 3.3.1 and I received the same error, in my case, the URL was an Object vs a string.

What happened was, that I took URL = window.location – which returned an object. Once I’ve changed it into window.location.href – it worked w/o the e.indexOf error.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment