Welcome Guest, Not a member yet? Register   Sign In
Javascript doesn't work after moving installation
#1

I've installed CodeIgniter on a shared hosting without ssl certificate, which worked perfectly fine. Today I've moved the installation to the private_html directory. This works as one would expect, all files are loaded fine, and work as they should, but the javascript files don't seem to work. The files are correctly loaded, but they don't do anything (which I find very strange). Does anyone recognize the problem and know the solution?

Regards, Folkert
Reply
#2

@Folkert
When you say they don't do anything...can you be more specific (JS errors? are you using browser developer tools to verify that the JS is not working?)? My first thought is to check the priviledges of the JS directory and files.
Reply
#3

@Folkert

check the console in brower that you have get any errors regarding JS and also check the Code that you have mentioned the JS directory path and check that wheather it's loaded propely.
Reply
#4

If your using Chrome web browser then it will ERROR on everything without https://

SSL
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#5

(This post was last modified: 10-12-2021, 10:21 AM by Folkert.)

Thank you very much for your reactions. I do indeed get some errors in the console that do not occur in the not-ssl version.
When i replace the files with a cdn version and remove the custom.js file, the errors do not occur, but the functionalities still don't work.

GET https://www.onlinedraaiboek.nl/ 404 ()
jquery.min.js:3 Uncaught SyntaxError: missing ) after argument list
bootstrap.min.js:7 Uncaught SyntaxError: Invalid or unexpected token
icheck.min.js:6 Uncaught TypeError: Cannot read property 'fn' of undefined
   at icheck.min.js:6
   at icheck.min.js:11
(anonymous) @ icheck.min.js:6
(anonymous) @ icheck.min.js:11
custom.min.js:2 Uncaught SyntaxError: Unexpected token ?

@php_rocs

the files are loaded correctly when i check the source-code in the browser. However, all functionalities that work with js, like dropdown menu's etc, do not work. I've tested this by adding alert('test') to the js file, which wasn't shown. when i write the alert directly in the <head>, it is shown, so you're probably right about the privileges. Do you have any idea about how to fix this?

Thanx!

Folkert
Reply
#6

@Folkert,

Check the permissions of your JS files and directories. If these are the public files then I would think the permissions should be 755 for the directories and files.

NOTE: for directories I would not go higher then 775 unless you need to write to the directory which it would then be 777
Reply
#7

(This post was last modified: 03-06-2018, 05:36 PM by php_rocs.)

@Folkert,

I assumed that you are FTPing your files to the server. If this is the case and you are using a tool like filezilla then checking the permissions of the directories and files are as easy as clicking once on the file or directory and selecting file attributes.
Reply
#8

See what @InsiteFX wrote. And I'll add that's not limited to Chrome.

Non-TLS links are nowadays treated as unsafe by default, so any plain-http linked resources will be blocked on a site loaded via https (that includes hard-coded links within JS too).
Reply




Theme © iAndrew 2016 - Forum software by © MyBB