How to deal with net::ERR_SSL_PROTOCOL_ERROR?

This is not a javascript problem, it’s an ssl probem. You can’t get a file through an insecure connection (http) from a html page served through a secure connection (https). If you’re going to use https (and you SHOULD!) then you need to get the script through a secure connection. To get the file, you … Read more

How to solve ‘Redirect has been blocked by CORS policy: No ‘Access-Control-Allow-Origin’ header’?

In addition to what awd mentioned about getting the person responsible for the server to reconfigure (an impractical solution for local development) I use a change-origin chrome plugin like this: Moesif Orign & CORS Changer You can make your local dev server (ex: localhost:8080) to appear to be coming from 172.16.1.157:8002 or any other domain.

“document.getElementByClass is not a function”

You probably meant document.getElementsByClassName() (and then grabbing the first item off the resulting node list): You may still get the error document.getElementsByClassName is not a function in older browsers, though, in which case you can provide a fallback implementation if you need to support those older browsers.

Download File Using JavaScript/jQuery

Use an invisible <iframe>: To force the browser to download a file it would otherwise be capable of rendering (such as HTML or text files), you need the server to set the file’s MIME Type to a nonsensical value, such as application/x-please-download-me or alternatively application/octet-stream, which is used for arbitrary binary data. If you only want to open it in a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)