My site has 2 pages
- Based on Page 1 value selection , I need to load the page content in Page 2
- I am passing page 1 selection to page 2 through URL parameter and reading the same in Page 2 & updating page 2 content based on values retrieved from my database
Page 1
export function button1_click_1(event, $w) {
let myValue = $w(“#dropdown1”).value;
let myurl=“/testquiz?module=”+ myValue
wixLocation.to(myurl);
}
Page 2
$w.onReady(function () {
let quizCode = wixLocation.query;
//console.log("Value of Quiz Code " + quizCode.module);
wixData.query(“MyQuizTopics”)
.eq(“quizTopic”, quizCode.module)
.find()
.then( (results) => {
let items = results.items;
let communityRecord = items[0];
$w(‘#html1’).src = communityRecord.courseLink;
} )
.catch( (error) => {
let errorMsg = error.message;
let code = error.code;
console.log(" Error Message " + errorMsg ) ;
console.log(" Error Code " + code ) ;
} );
My website
page 2: Dynamic Page
The permissions are set as “Anyone” for the collection but still facing this issue.
Kindly help