views:

683

answers:

3

I have created some jQuery and put it in an ascx include. It works fine on regular pages, however when I load a secured page on my site I get the following javascript error.


Permission Denied jquery.min.js Code: 0


Any ideas?

A: 

How are you referencing the jQuery min file? If you are using a fully qualified URL to the library, and that URL specifies HTTP rather than HTTPS, this would cause the error you describe.

For example:

<script type="text/javascript" src="http://www.example.com/scripts/jquery.min.js"&gt;&lt;/script&gt;

This would cause errors if your site was being served under HTTPS.

BradBrening
I'm not actually making any explicit reference to it. DNN has jquery built into it by default. It appears to work ok without a reference, but just not in SSL
Dkong
I'm going to take a shot and guess that DNN is probably referencing jQuery through a CDN like Google:http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js Note the HTTP in the URL, that would cause the issue.
BradBrening
+2  A: 

Assuming you're using the hosted jQuery by the Google CDN, you can change the hosted script address to use https instead of http:

Host -> Host Settings -> Advanced Settings -> jQuery Settings ->

Screenshot of Host Settings

References

Updated

This permissions error can occur when you're attempting to make an $.ajax() request using jQuery from a secure URL (https) to a non-secure URL (http) even though they are the same domain. Changing the url parameter to use a relative URL should fix the issue.

Lance McNearney
Lance, I changed to the below but I am still getting the same message. The file is definitely there because I copied and pasted the location from the URL below:https://www.mywebsite.com/resources/shared/scripts/jquery/jquery.min.js
Dkong
A: 

In my experience, the "Permission Denied" error comes from trying to access a window that is in a different domain than you. In the code that you listed, is ctl a reference to a popup window, or some window other than the window that the code is running in? If that window is at http://mysite.com and your script is running on https://mysite.com, you'll get the Permission Denied error.

bdukes

related questions