RT53 Posted December 15, 2021 Posted December 15, 2021 (edited) I'm really hoping someone can help me with this. I'm looking for code (presumably javascript) that will prevent my site from running on Internet Explorer (and instead will show a message similar to the attached image). And if someone could walk me through how to do this, that'd be great - I don't currently have a business account on squarespace, so if I can't do this in a markdown block then I'll just upgrade to a business plan. Thanks very much in advance! Edited December 15, 2021 by RT53
paul2009 Posted December 15, 2021 Posted December 15, 2021 1 minute ago, RT53 said: I'm looking for code that will prevent my site from running on Internet Explorer. I don't have a business account on squarespace This is easy to do but you’ll need a Business Plan. RT53 1 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
RT53 Posted December 15, 2021 Author Posted December 15, 2021 1 minute ago, paul2009 said: This is easy to do but you’ll need a Business Plan. Hi Paul - thanks very much for your response! I can't just put the code in a markdown block? If not, then I'll just upgrade to business. Would you be able to tell me what to do assuming that I have a business plan?
Solution paul2009 Posted December 15, 2021 Solution Posted December 15, 2021 (edited) If you create your informative page, for example a page called called Browser Warning (page with a URL of /browser-warning), you should be able to redirect customers to this page if they are using IE by adding something like this to Settings > Advanced > Code Injection > Header: <script> if (window.location.pathname != "/browser-warning") { if (/MSIE|Trident/.test(window.navigator.userAgent)) window.location.href = '/browser-warning'; } </script> However there are free tools available that can help you to inform users of all older browsers with an announcement bar style warning. For more information, take a look at https://browser-update.org/ Edited December 17, 2021 by paul2009 Updated RT53 1 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
RT53 Posted December 15, 2021 Author Posted December 15, 2021 24 minutes ago, paul2009 said: If you create your informative page, for example a page called called Browser Warning (page with a URL of /browser-warning), you should be able to redirect customers to this page if they are using IE by adding something like this to Settings > Advanced > Code Injection > Header: <script type="application/javascript"> if (/MSIE|Trident/.test(window.navigator.userAgent)) window.location.href = '/browser-warning'; </script> However there are free tools available that can help you to inform users of all older browsers with an announcement bar style warning. For more information, take a look at https://browser-update.org/ Hi Paul - this is working great! But the only thing is that it's coming up as a blank page. How do I add text? (I want to tell the user that this browser doesn't support myself and direct them to download chrome, firefox, etc.)
paul2009 Posted December 15, 2021 Posted December 15, 2021 (edited) 1 hour ago, RT53 said: this is working great! But the only thing is that it's coming up as a blank page. Create a new page, give it the name Browser Warning (or change the URL in the code) and add your messages to this page. If this post has helped you, please click a 'Like' or 'Thanks' icon below ⬇️ Edited December 15, 2021 by paul2009 RT53 1 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
RT53 Posted December 16, 2021 Author Posted December 16, 2021 17 hours ago, paul2009 said: Create a new page, give it the name Browser Warning (or change the URL in the code) and add your messages to this page. If this post has helped you, please click a 'Like' or 'Thanks' icon below ⬇️ But if I add a new page, then it shows up in my navigation bar. Am I doing something wrong? I just don't know how to add a new page and not have it show on my site.
paul2009 Posted December 16, 2021 Posted December 16, 2021 23 minutes ago, RT53 said: But if I add a new page, then it shows up in my navigation bar. Add the new page to the NOT LINKED section below the MAIN NAVIGATION section. Pages in this section don't appear in the navigation. RT53 1 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
RT53 Posted December 16, 2021 Author Posted December 16, 2021 59 minutes ago, paul2009 said: Add the new page to the NOT LINKED section below the MAIN NAVIGATION section. Pages in this section don't appear in the navigation. Thank you so much! This is perfect. So now that I made a page for the browser warning message, the page shows my header and footer (and allows for navigation on the site). If you have time, do you know how I can exclude the header/footer from this page? Thank you again for sharing your expertise!! paul2009 1
paul2009 Posted December 16, 2021 Posted December 16, 2021 21 minutes ago, RT53 said: If you have time, do you know how I can exclude the header/footer from this page? Can you share the URL of the page with me? If the site isn't live yet, you'll also need to set a public password in the visibility settings and share this too 🙂 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
RT53 Posted December 16, 2021 Author Posted December 16, 2021 (edited) On 12/16/2021 at 1:30 PM, paul2009 said: Can you share the URL of the page with me? If the site isn't live yet, you'll also need to set a public password in the visibility settings and share this too 🙂 Definitely - thank you! Edited December 17, 2021 by RT53
RT53 Posted December 16, 2021 Author Posted December 16, 2021 (edited) On 12/16/2021 at 3:13 PM, RT53 said: Definitely - thank you! Ah, the site is also blinking for some reason now that i put in the url for my browser-warning page... not sure how to stop it. This is the code updated with that page's url: <script type="application/javascript"> if (/MSIE|Trident/.test(window.navigator.userAgent)) window.location.href = 'https://www.xxxx-xxxx.com/browser-warning'; </script> <script> var $buoop = {required:{e:-4,f:-3,o:-3,s:-1,c:-3},insecure:true,api:2021.12 }; function $buo_f(){ var e = document.createElement("script"); e.src = "//browser-update.org/update.min.js"; document.body.appendChild(e); }; try {document.addEventListener("DOMContentLoaded", $buo_f,false)} catch(e){window.attachEvent("onload", $buo_f)} </script> Edited December 17, 2021 by RT53
paul2009 Posted December 16, 2021 Posted December 16, 2021 (edited) You should be able to hide the header and footer on this page by adding something like this to Design > Custom CSS: #collection-61bb17a650cfa105a3b695ee header, #collection-61bb17a650cfa105a3b695ee footer { display: none!important; } Notes: The blinking should only occur when you are logged on; it's a symptom of the preview window. Visitors won't see it. The collection ID is specific to this page on your site. Anyone else following this thread will need to identify the ID of their page. Edited December 16, 2021 by paul2009 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
RT53 Posted December 17, 2021 Author Posted December 17, 2021 Paul, thank you so much! So, the header is gone, but the footer is now blank white space (the rest is grey) - if there's no fix for that then worst case scenario I can just make the whole page white so it blends. But the page is blinking not when I'm logged on - it's blinking when I try to open my site's URL (ie, I'm not logging on to squarespace to access the site, but rather just going straight to my website)... Do you know if there's any fix for this? I hope so!
paul2009 Posted December 17, 2021 Posted December 17, 2021 1 hour ago, RT53 said: the rest is grey This is because the page is short. If you make the page longer, by adding empty lines of text or a Spacer Block below the current messages, you should not see this area. 1 hour ago, RT53 said: the page is blinking...just going straight to my website This is a simple code snippet to divert IE users to a warning page as soon as they arrive on the site. As it requires a second page to be loaded (the page containing the message), this will cause the two pages to load in quick succession. This may be what you refer to as 'blinking'. I can write more complex solutions but they would require a longer explanation making them unsuitable for posting on the forum. RT53 1 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
RT53 Posted December 17, 2021 Author Posted December 17, 2021 1 hour ago, paul2009 said: This is because the page is short. If you make the page longer, by adding empty lines of text or a Spacer Block below the current messages, you should not see this area. This is a simple code snippet to divert IE users to a warning page as soon as they arrive on the site. As it requires a second page to be loaded (the page containing the message), this will cause the two pages to load in quick succession. This may be what you refer to as 'blinking'. I can write more complex solutions but they would require a longer explanation making them unsuitable for posting on the forum. Ah got it... it blinks repeatedly (like it doesnt stop blinking unless you just close the browser) so then I think I'll just go back to your original script and forgo the text that I wanted to appear. Thanks for all your help 🙂
paul2009 Posted December 17, 2021 Posted December 17, 2021 25 minutes ago, RT53 said: Ah got it... it blinks repeatedly Apologies. That's completely my fault because I didn't test it! 🤪 Please try the revised code above. RT53 1 Me: I'm Paul, a SQSP user for >18 yrs & Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF.DIGITAL. We provide high quality original extensions to supercharge your Squarespace website. Content: Views and opinions are my own. Links in my posts may refer to my own SF.DIGITAL products or may be affiliate links. Forum advice is completely free. You can thank me by selecting a feedback emoji. Buying a coffee is generous but optional.
RT53 Posted December 19, 2021 Author Posted December 19, 2021 On 12/17/2021 at 11:33 PM, paul2009 said: Apologies. That's completely my fault because I didn't test it! 🤪 Please try the revised code above. This works perfectly. Thank you again so much for your generosity with your expertise!! paul2009 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment