URL Parameters & Default Load Are Mixed Up

Hello,

I have a page with the following code. However, the default page address without any parameters and my START parameter both seem to still follow the other scroll to rules of other url parameters.

Can someobdy please review this and tell me what am I doing wrong here that the default page still behaves as if it is going to core or adwords or others?

I can confirm core, adwords, and vcmo parameters work just fine when used appropriately. But default url and start parameters do not work correctly. All attempts to load the page end up at payment scroll visually.

Thanks

import wixLocation from ‘wix-location’;

export function termsbutton_click() {
$w(‘#termsbutton’).hide();
$w(‘#close’).show();
$w(‘#terms’).show();
}
export function close_click() {
$w(‘#expand2’).show();
$w(‘#close’).hide();
$w(‘#terms’).collapse();
}
export function expand2_click() {
$w(‘#expand2’).hide();
$w(‘#close’).show();
$w(‘#terms’).expand();
}
export function button1_mouseIn() {
$w(‘#anchorMenu1’).show();
$w(‘#button1’).hide();
}
export function anchorMenu1_mouseOut() {
$w(‘#anchorMenu1’).hide();
$w(‘#button1’).show();
}
$w.onReady(() => {if(wixLocation.query.param === ‘start’)
$w(“#top”).scrollTo();
});
$w.onReady(() => {if(wixLocation.query.param === ‘core’)
$w(“#payslides”).changeSlide(0);
$w(“#payment”).scrollTo();
});
$w.onReady(() => {if(wixLocation.query.param === ‘adwords’)
$w(“#payslides”).changeSlide(1);
$w(“#payment”).scrollTo();
});
$w.onReady(() => {if(wixLocation.query.param === ‘vcmo’)
$w(“#payslides”).changeSlide(2);
$w(“#payment”).scrollTo();
});

I even tried to clean up my code and make it more proper, but still things are the same on the front end

import wixLocation from ‘wix-location’;

export function termsbutton_click() {
$w(‘#termsbutton’).collapse();
$w(‘#close’).show();
$w(‘#terms’).show();
$w(‘#terms’).expand();
}
export function close_click() {
$w(‘#termsbutton’).expand();
$w(‘#close’).collapse();
$w(‘#terms’).collapse();
}
export function button1_mouseIn() {
$w(‘#anchorMenu1’).show();
$w(‘#button1’).hide();
}
export function anchorMenu1_mouseOut() {
$w(‘#anchorMenu1’).hide();
$w(‘#button1’).show();
}
$w.onReady(() => {
if(wixLocation.query.param === ‘start’)
$w(“#top”).scrollTo();
if(wixLocation.query.param === ‘core’)
$w(“#payslides”).changeSlide(0);
$w(“#payment”).scrollTo();
if(wixLocation.query.param === ‘adwords’)
$w(“#payslides”).changeSlide(1);
$w(“#payment”).scrollTo();
if(wixLocation.query.param === ‘vcmo’)
$w(“#payslides”).changeSlide(2);
$w(“#payment”).scrollTo();
});

There is no .param in the query object. Use it like this.
let query = request.query; // {“species”: “african-elephant”}

Hi,
As Andreas mentioned, there’s no such option “wixLocation.query.param”.
Click here to get more information about the query function of the Wix Location API.

Have a good day,
Tal.

Hi Tal,
Is it possible to remove the query parameter by code? I have a parameter and this is shown in every page .

The documentation for wix-location .query returns an object. Can you give an example of how to retrieve values from this object. I couldn’t find any material for this