messed code up with } & )'s

Hi,
I had my code working fine untill i did something and i cant rectify it.
Anybody point out my errors?

Site Code;

import {session} from ‘wix-storage’;
import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;
import wixData from ‘wix-data’;

let previousURL = session.getItem(‘previousURL’);
session.setItem(‘previousURL’, wixLocation.url);

export function getPreviousPageLink() {
if (previousURL === session.getItem(‘previousURL’)) {
wixLocation.to(‘/’)
} else {
wixLocation.to(previousURL);
}
}

export function continueShopping_click(event) {
getPreviousPageLink();
return false ;
}

//----------------------------------------------------------------------------
import {local} from ‘wix-storage’;
$w(‘#searchButtonHeader’).onClick(() => {
const searchTerm = $w(‘#searchFieldHeader’).value
local.setItem(“searchTerm”, searchTerm);
});

//---------------------------------------------------------
$w.onReady( function () {
if (wixWindow.formFactor === “Mobile”) {
$w(‘#searchFieldHeader’).collapse()
$w(‘#searchIconHeader’).collapse()
$w(‘#searchButtonHeader’).collapse()
}

$w(‘#searchButtonMobile’).onClick(() => {
if ( $w(“#searchFieldHeader”).collapsed ) {
$w(“#searchFieldHeader”).expand();
}
else {
$w(“#searchFieldHeader”).collapse();
}

if ( $w(“#searchButtonHeader”).collapsed ) {
$w(“#searchButtonHeader”).expand();
}
else {
$w(“#searchButtonHeader”).collapse();
}

if ( $w(“#searchIconHeader”).collapsed ) {
$w(“#searchIconHeader”).expand();
}
else {
$w(“#searchIconHeader”).collapse();
}

})
})

Page Code;

import wixWindow from ‘wix-window’;
import {local} from ‘wix-storage’;
import wixData from ‘wix-data’;

//---------------------------------------------

function filter(title) {
$w(‘#dynamicDataset’).setFilter(wixData.filter().contains(‘name’,title));
}

export function searchButtonPage_click(event) {
filter($w(‘#searchFieldPage’).value);
}

$w.onReady( function () {
$w(‘#searchFieldPage’).value = local.getItem(“searchTerm”);

})
$w(“#searchFieldPage”).onKeyPress((event, $w) => {
if (event.key === “Enter”) {
filter($w(‘#searchFieldPage’).value);
}
})

//----------------------------------------

$w.onReady( function () {
if (wixWindow.formFactor === “Mobile”) {
$w(“#column5”).collapse();

} 

});

Thanks
Matt

Download Visual Studio Code and then paste in your code and save that file as a .js file and it will lead you to the correct errors regarding missing or to many {} () I use it daily for that.

I carefully re read through my code and found I had some function before page ready action.
Thanks for the tip :+1:t2: