Hi every body
When somebody click on a link like www.mysite.com/test?id=1234 I need that the page “test” include a script to parse the URL and get the value “1234” because I need to use it to update a variable.
I’ve tried using something like the following code but it doesn’t work:
import wixLocation from ‘wix-location’;
$w.onReady(function () {
let query = wixLocation.query;
let id = query. id;
}
Can you help me writing the correct and complete script?
Thks
Bye
What kind of error do you get? Do you try this in preview mode or published mode? I believe you should test it in published mode and also do a console.log(query); so you can inspect that.