views:

20

answers:

1

I'm developing a web form that is SSL encrypted. I have jquery.form.js local on the server. Yet, the page renders with error "jquery undefined". The error goes on to explain that it can't find jquery.form.js.

What does that mean? Can't I include that js file into a page that is SSL encrypted?

Thanks, TheGetz

A: 

Some users have their browser set to exclude non-secure content, e.g. you can't include a script from http:// on an https:// page and reliably have it work. If your file is local to the server either make it a relative URL, like this:

<script src="/js/jquery.form.js" type="text/javascript"></script>

Or if it's not on the same domain, use a protocol relative URL, like this:

<script src="//mystaticdomain.net/js/jquery.form.js" type="text/javascript"></script>

This will switch between http and https as needed (it'll be whatever the page is), just make sure that other domain is setup to service with an SSL cert as well.

Nick Craver