JS in textarea not working when uploaded to netlify

Dear Netlify Community Supporters

I got a problem. I have made a character countdown in my page, which counts how many characters you have left to type in a textarea. It all works locally, but as soon as I deploy the page here on Netlify, it doesn’t work anymore.

I have already tried to upload the page again and also upload a copy of it. I also tried to put the code into a separate .js file and then mention it in html, but it didn’t work. So I put the JS code directly into the html file and uploaded it and it still didn’t work.

There are no error messages, etc. Only this one thing doesn’t work, and I’ve been on it for a long time now.

My Netlify instance name is 15min (my site therefore is 15min.netlify.com)

I searched the whole internet like crazy, but i didn’t find anything relateable to this. I even went through the common issue search term, but even there was nothing.

Here is the link that i found the code in:
http://geoffmuskett.com/really-simple-jquery-character-countdown-in-textarea/

Do you know why that might be? If so, I would be happy for any help I can get

Many thanks in advance

TRG

So dear people, I just found out:
All the time it was because I had mixed content and the site refused to load the jquery correctly. But I could fix that now.

Thanks anyway!

TRG

2 Likes

Hey, thanks so much for the follow-up with the solution! That’s something that will almost certainly come up for another customer in the short term, and your answer is useful to many.

Kudos and have a great weekend!

Hi @TRGamer-tech – great that you got it working, but can you clarify a bit about what you mean by mixed content? ( for my own edification )

I got it sorted as I also just got this message on a practice build.

“Although you have enabled HTTPS on your site, we’ve detected some content that’s still being served over an HTTP connection. This phenomenon, called mixed content, happens when both HTTP and HTTPS are being used to load the same page.”

Mixed content means a part of your site is written for http and not for https. That mean in my case I had clarified a linked resource for jquery, which wasn’t made for https.

I read the very same Email over and over and I didnt care till I noticed my problem. But then I looked into the mail and there it said that the error is in the deploy details.

Like here:

And then it said I should go and see in the console of the page which has the mixed content in it (Picture above), which I did.

Like here: why hosted at ImgBB — ImgBB (sorry I’m a new user and I cant put two images in one post yet)

I fixed it by searching in google:
“jquery mixed content https”

and clicked on this link (which i found by scrolling a bit down):

[Joomla Forums](Mixed Content - HTTPS / jQuery issue - Joomla! Forum - community, help and support

and there it said:

Hi,
I think because you are using https on the website it means that you need to change the ‘http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js’ (your current linked jquery resource) url address to ‘https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js’ (the new working jquery linked resource)

And that was the solution. I was so glad i found it.

I hope I helped you too.

If you still have any questions feel free to ask

Greetings

TRG

1 Like

Thanks for sharing a few more details. :pray:

If you PM @discobot start new user or @discobot start advanced – you may get your rank increased to where you can post more.

2 Likes

Hi! To find out what I can do, say @discobot display help.

1 Like