Problem: URL redirects don’t work unless the page is accessed directly (or browser is refreshed), as I believe Javascript is doing some sort of request or “Promise” with Velo.
Example: websitedomaindotcom/products
Click on a product (websitedomaindotcom/product-page/candle/) - a redirect already exists (websitedomaindotcom/product-page/candle/ TO newwebsitedomaindotcom/product/candle/)
BUT website loads old URL
Refresh the page, THEN it redirects to new page
How do I disable this Velo thing, or at least the portion that “ajax” loads the page so it’s a standard HTTPS request?
Getting such issues, are in most cases cause by the following …
a) You do not wait for your PAGE to be ready first
b) You do not wait your DATASET to be ready first (if dataset is in usage)
c) You do not use → ASYNC-AWAIT (wrong handling of promises)
d) making a request and getting a response → FETCHING DATA ← should also run ASYNCHROUNOUS.
Example: ( a )
$w.onReady(()=>{console.log('Page is ready!!!');
});
Example: ( b )
$w.onReady(()=>{console.log('Page is ready!!!');
$w('#myDatasetIDHere').onReady(()=>{console.log('Dataset is ready!');
});
});
Example: ( c )
$w.onReady(()=>{console.log('Page is ready!!!');
$w('#myDatasetIDHere').onReady(async()=>{console.log('Dataset is ready!');
const results = await start_myAsynchronousFunction();
});
});
async function start_myAsynchronousFunction() {
console.log('..my function started...');
}
The same princip for http-requests!
And there is another usecase if you refresh a dataset → dataset.refresh() <—
It is not my hostility, it is more how much efforsts you make → to get a valuable answer.
Just to ask a question, generated in 5 sec. without any details → and then expecting a one-shot solution (for free)
But i know such persons like you! And i teach them how to do it better!
I suppose I’m not asking the right questions then. I know very little about the Wix editor (I’m used to Wordpress/woocommerce). I also know literally nothing about Velo, and very little about JS. What do you need?
a) If not → show your setup (pics) → describe your process-flow.
b) If you have already integrated some code on your site, related to your issue → show show it.
Your description could/should be like…
When i am on my Product-Page, i do the following action + (pic)
But when i do the action → something goes wrong.
I did setup a redirect → pic of showing how you exactly did it
Since i am not using CODE → i will present my SETUP in PICS and describe which elements are involved…
used-elements…
-button (id)
-dataset(dataset-id)
process-flow…
my process starts with
2)…
3)…
4)…
and ends with the issue that i get a wrong redirection and it only works after refresh.
ADDITIONAL:
I have implemented some → CONSOLE-LOGS ← which maybe could help to solve the issue.
Ok, and now slowly!
I understand that you are not familiar with wix.
But you should udnerstand, that only you see your generated SETUP in front of you.
If you would have done everything by code → you just would have to show your code → so it would be easy to detect the issue very fast by code-investigation.
But since you do not use code and anybody can really see how you have contructed your setup, it is difficult to imagine what is going on, on your side.
This is why a more detailed description (including pics) would surely help much more to solve your problem.
You can also try to solve it on your own → by implementing some console-logs into your setup.
How to do?
You activate the DEV-MODE (developer-mode) in your wix-editor ( already done? );
You navigate to your product page (i asume that the product page is our starting point).
Since you started the dev-mode, you now see more options in your wix-editor → now you are not only a DESIGNER, but also a → PROGRAMMER.
I feel like this is more of a “I had an old domain, connected a new domain but my old domain is still being displayed in the browser bar” sort of question instead of a Velo issue where you actually wrote Velo code gone wrong.
Based on what you show here…
If so, you need to swap the domain as main vs secondary.
If not, post a screenshot of your code and/or a video to better visualize what you are trying to articulate.
Thanks @CODE-NINJA ! Now I have a JSON table of data. Can I use some of that data along with Velo functions now to “turn off” the way the browser requests the URL?
@CODE-NINJA no, I did not see that I could expand the quoted post. Taking a look now.
EDIT: it won’t let me post more than 20 times so I’m replying here.
@CODE-NINJA I’m not sure that post is applicable, except for getting the JSON data the console provides. Did you watch the screen capture I made? That clearly describes my issue, but perhaps I’m missing something?
EDIT 2:
Yes! That would work! Hmm, how do I do that @CODE-NINJA ??