Sharif_Shimanta Posted November 9, 2021 Share Posted November 9, 2021 Site URL: https://www.hairdresserswellingborough.com/test Site URL: https://www.hairdresserswellingborough.com/test Hello, I have a script provided from https://www.mylocalsalon.co.uk/. Which working fine in https://www.w3schools.com/jquery/tryit.asp?filename=tryjquery_lib_google . But in Squarespace, I inserted the script and nothing showing! However, I managed to show the block but it is not changing dynamically as it should do. Website link: https://www.hairdresserswellingborough.com/test Script used : <!--Your plug-in code can be customised to look like your website using the following styling elements. .SCMyWebsitePlugin-score .SCMyWebsitePlugin-score div .SCMyWebsitePlugin-mlsLink li#SCMyWebsitePlugin-firstItem li#SCMyWebsitePlugin-lastItem #SCMyWebsitePlugin-main #SCMyWebsitePlugin-reviewListDiv --> <div id="SCMyWebsitePlugin-main" data-site_id="43a01004-5146-e911-a9a6-000d3a81ec09" data-number_of_reviews="3" data-no_styles="true" data-change_time="1000" data-character_limit="200" data-total_reviews="20" data-use_microdata="true" /> <script type="text/javascript"> (function() { var newScript = document.createElement('script'); newScript.type = "text/javascript"; newScript.src = "https://ratings.mylocalsalon.com/widget/mywebsite"; var firstScript = document.getElementsByTagName('script')[0]; firstScript.parentNode.appendChild(newScript); })(); </script> Any Idea about how to solve this? Thanks in advance! Beyondspace 1 Link to comment
paul2009 Posted November 9, 2021 Share Posted November 9, 2021 Can you explain what isn't working? This is what I see: About: SQSP User for 17 yrs. Circle Leader since 2017. I value honesty, transparency, diversity and good design ♥. Work: Founder of SF Digital, building Squarespace Extensions to supercharge your commerce website. Content: Links in my posts may refer to SF Digital products or may be affiliate links. If my advice helped, you can thank me by clicking one of the feedback emojis below. I love coffee too. Link to comment
Sharif_Shimanta Posted November 9, 2021 Author Share Posted November 9, 2021 (edited) @paul2009 Thanks for the reply. It should dynamically populate new reviews to slide up. Please run the code in https://www.w3schools.com/html/tryit.asp?filename=tryhtml_default_default to get the exact idea. For example, a 4th hidden review block should take place of the 3rd review after a certain time period. Edited November 9, 2021 by Shimi Beyondspace 1 Link to comment
Sharif_Shimanta Posted November 10, 2021 Author Share Posted November 10, 2021 @paul2009 I have attached the actual function it should do. bandicam 2021-11-10 15-15-23-115.mp4 Beyondspace 1 Link to comment
Beyondspace Posted November 10, 2021 Share Posted November 10, 2021 2 hours ago, Shimi said: @paul2009 I have attached the actual function it should do. bandicam 2021-11-10 15-15-23-115.mp4 I can see the root cause, Squarespace added a method to Array object called removeRange, which will be included in the for...in loop inside localsalon script, which break the code to loop to next review item. Does your provider allow to embed code in a iframe instead? paul2009 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Beyondspace Posted November 10, 2021 Share Posted November 10, 2021 (edited) BTW, I made change to your snippet to add it into iframe to get rid of squarespace issue <iframe id="mylocalsalon-frame" src="javascript:void(0);"></iframe><style> #mylocalsalon-frame { width: 100%; border: none; height: 300px; overflow: hidden; }</style><script> const iframeElement = document.querySelector('#mylocalsalon-frame'); const htmlContent = "<!--Your plug-in code can be customised to look like your website using the following styling elements. .SCMyWebsitePlugin-score .SCMyWebsitePlugin-score div .SCMyWebsitePlugin-mlsLink li#SCMyWebsitePlugin-firstItem li#SCMyWebsitePlugin-lastItem #SCMyWebsitePlugin-main #SCMyWebsitePlugin-reviewListDiv --> <div id='SCMyWebsitePlugin-main' data-site_id='43a01004-5146-e911-a9a6-000d3a81ec09' data-number_of_reviews='3' data-no_styles='true' data-change_time='1000' data-character_limit='200' data-total_reviews='20' data-use_microdata='true'/> <script type='text/javascript'> (function() { var newScript = document.createElement('script'); newScript.type = 'text/javascript'; newScript.src = 'https://ratings.mylocalsalon.com/widget/mywebsite'; var firstScript = document.getElementsByTagName('script')[0]; firstScript.parentNode.appendChild(newScript); })();<\/script>"; iframeElement.contentWindow.document.open(); iframeElement.contentWindow.document.write(htmlContent); iframeElement.contentWindow.document.close();</script> Paste the snippet to a code block on your site to make MyLocalSalon Review Script working on Squarespace site Edited November 10, 2021 by bangank36 Sharif_Shimanta 1 BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Sharif_Shimanta Posted November 10, 2021 Author Share Posted November 10, 2021 @bangank36 It is working absolutely Fine!!!! Thank you so much. Much appreciated. Beyondspace 1 Link to comment
Beyondspace Posted November 10, 2021 Share Posted November 10, 2021 2 minutes ago, Shimi said: @bangank36 It is working absolutely Fine!!!! Thank you so much. Much appreciated. I suggest you forward my revealation to the provider, they should for...of loop instead to solve it completely BeyondSpace - Squarespace Website Developer 🖼️ Lightbox Studio (Enable Pinch/Zoom on lightbox) 🗓️ Delivery Date Picker (Squarespace Date format) 💫 Animated Buttons (Referral URL) 🥳 Sparkplugin Customisations Browsers (Browse +100 Spark plugin customisations) 🥳 Elfsight Template Browsers (Browse +1000 Elfsight widget Templates) If you find my answer useful, let's leave a like or upvote so others with the same issue can find their solution. Thank you! Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment