Forum Moderators: open

Message Too Old, No Replies

Problems with src=//abc.def.com construct .

Does src=//abc.def.com without the http or https always work?

         

hicinbothem

5:55 pm on Jul 25, 2006 (gmt 0)

10+ Year Member



Ran across some code that uses src= without the http or https in order to avoid messages warning of jumping between secure and non-secure sites. It seems a bit cleaner than using a javascript test to choose the proper value (http/https) but some recent experiences lead me to believe it doesn't 'always' work for https pages ...

So ... the question ... are there reasonably recent browser versions that do NOT support code that looks like:

<script language="javascript" src="//abc.def.com/scripts/stuff.js" type="text/javascript">
</script>

Are there settings that may prevent this from working (either in the browser or in the abc.def.com server?

Thanks for your help!
=Fred

encyclo

1:40 pm on Aug 3, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld hicinbothem! Sorry it took so long for you to get a reply.

With the example given above, the URL is likely to fail in most cases. If your site is example.com, then the URL you have would link to:

http://example.com//abc.def.com/scripts/stuff.js

If you are linking to an external resouce, you must always use the full "http" or "https" syntax.