I want to modify the code <script src="http://connect.facebook.net/en_US/all.js#xfbml=1"></script> PHP: to <script src="//connect.facebook.net/en_US/all.js#xfbml=1"></script> PHP: So it will automatically pick up if the current URL is https or http. Am I correct in that modification or would that break the page?
Nice try, but no cigar. This is not how it works.Try this: var Host = (("https:" == document.location.protocol) ? "https://" : "http://");document.write(unescape("%3Cscript src='" + Host + "connect.facebook.net/en_US/all.js#xfbml=1' type='text/javascript'%3E%3C/script%3E")); HTML:
it will not load the script.. you should put http or https before the html gets rendered.. maybe make a variable that will be the flag if you are using https or http. <script src="<?php echo $is_ssl?'https':'http'; ?>//connect.facebook.net/en_US/all.js#xfbml=1"></script> PHP:
document.write(unescape("")); Code (markup): seems to work pretty well. (It's how Google's jQuery link works.)