Thread Tools Display Modes
  #1  
Old 01-03-2020, 10:22 AM
Chudri 420's Avatar
Chudri 420 is offline
Junior Member
 
Join Date: Jan 2020
Posts: 1
Default

How to force refresh each page in rails


I can't seem to figure out how to turn of the cache successfully in my rails app. The website I made is http://www.liftlineclothing.com and upon using the navbar to click to the clothing page, the clothes do no appear unless you refresh the page once you are on it. As well, when navigating back to the homepage, the Javascript to get the text to fly in does not appear unless you refresh the page as well.

I am pretty sure this is a cache problem but if any one has some ideas, I would really appreciate it. I have gone in the config file and changed the rails cache to false.

UPDATE

here is the javascript

var pausebetweenmsg=10 //customize pause in miliseconds between each message showing up
(3000=3 seconds)
var glidespeed=50 //customize glide speed in pixels per frame.

var curobjindex=0

function actualstyle(el, cssproperty){
if (el.currentStyle)
return el.currentStyle[cssproperty]
else if (window.getComputedStyle){
var elstyle=window.getComputedStyle(el, "")
return elstyle.getPropertyValue(cssproperty)
}
}

function collectElementbyClass(){
var classname="glidetext"
glidearray=new Array()
var inc=0
var alltags=document.all? document.all : document.getElementsByTagName("*")
for (i=0; i<alltags.length; i++){
if (alltags[i].className==classname)
glidearray[inc++]=alltags[i]
}
if (glidearray.length>0)
onebyoneglide()
}

function onebyoneglide(){
if (curobjindex<glidearray.length)
glidetimer=setInterval("glideroutine()",50)
}

function glideroutine(){
if (parseInt(actualstyle(glidearray[curobjindex], "left"))<0)
glidearray[curobjindex].style.left=parseInt(actualstyle(glidearray[curobjindex], "left"))+50+"px"
else{
glidearray[curobjindex].style.left=0
curobjindex++
clearInterval(glidetimer)
setTimeout("onebyoneglide()", pausebetweenmsg)
}
}

if (window.addEventListener)
window.addEventListener("load", collectElementbyClass, false)
else if (window.attachEvent)
window.attachEvent("onload", collectElementbyClass)
else if (document.getElementById)
window.onload=collectElementbyClass
This send the text flying onto the page from the homepage that is not working when navigated to from another page. You have to refresh the home page as well.

As for the clothing javascript, that is handle by ecwid. I will update once I can locate the specific javascript that is being used by them.
  #2  
Old 01-05-2020, 06:48 PM
Ksenia Avdonina's Avatar
Ksenia Avdonina Ksenia Avdonina is offline
Ecwid Team
 
Join Date: Jul 2019
Posts: 16
Default

Hello,
This is Xena, Ecwid Customer Care team. Thanks for your message!

I've checked your website: http://www.liftlineclothing.com/ and see that the store is indeed displayed only after refreshing a website page.

I've saved your store page locally as an HTML file and should say that the issue wasn't reproduced as the store was displayed just fine. Here is the video showing this: https://ecwid.d.pr/jQW5xg

I've also inspected the browser console and see that there are errors connected to the JS script of one of the website elements, screenshot: https://ecwid.d.pr/Kc8s84

In this case, I'd recommend that you check your website script as it seems as if some of its elements overlaps the storefront code and which is why it is displayed only after refreshing the page.

Moreover, make sure that your Ecwid store is added correctly. Just in case, here is the instruction on how to embed Ecwid to a custom website: https://support.ecwid.com/hc/en-us/a...or-any-website

If you have any other questions, please feel free to contact us.
__________________
Warmly,
Xena

Ecwid Customer Care team
  #3  
Old 01-30-2020, 11:11 AM
RuskinF's Avatar
RuskinF RuskinF is offline
Junior Member
 
Join Date: Jan 2020
Posts: 9
Default

I checked your page now and it didn't have any problem.
Everything loaded correctly and nothing changed after refreshing the page.
Are you still facing a problem with your website?
  #4  
Old 08-12-2020, 03:23 AM
alberthines's Avatar
alberthines alberthines is offline
Junior Member
 
Join Date: Aug 2020
Posts: 1
Default

This solved my problem. Thanks.

8 ball pool

Last edited by alberthines; 11-19-2020 at 08:31 AM.
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 03:20 PM.
Powered by vBulletin® Version 3.8.11. Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.