Working in Preview but not working on Publish

My site has 2 pages

  1. Based on Page 1 value selection , I need to load the page content in Page 2
  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 1 : https://editor.wix.com/html/editor/web/renderer/edit/30b68466-d8b6-4179-b33a-ac2f417ac50d?metaSiteId=fc94be9b-c7af-44e8-bd59-d913f923f6bf

page 2: Dynamic Page

The permissions are set as “Anyone” for the collection but still facing this issue.

Kindly help

Hi,
You set “testquiz” as a dynamic page which it functions as a static page.
The path of a dynamic page is expecting a prefix url:
https://www.legendsofequality.com/ testquiz /someDynamicContent.
My suggestion for you is to set it as a static page “Remove Dynamic Connections” and it should work.
Please update in your progress.
Roi.