Help with code for URL paramaters

Added this code to the page, but it doesn’t work. any ideas

import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;

$w.onReady( function () {
//TODO: write your page related code here…

let query = wixLocation.query; // {“species”: “african-elephant”}
function popUpMessage(message) {
wixWindow.openLightBox(‘Code for ICARIS’, {‘message’:query});
}
});

You have to call the popUpMessage() function.

put in the call and get:

TypeError: _wixWindow2.default.openLightBox is not a function

This is what I have:

// For full API documentation, including code examples, visit Velo API Reference - Wix.com

import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;

$w.onReady( function () {
//TODO: write your page related code here…

let query = wixLocation.query;
function popUpMessage(message) {
wixWindow.openLightBox(‘Code for ICARIS’, {‘message’:query});
}
popUpMessage(‘ICARIS’)
});

You can’t call a local function from the global scope, so either declare the function in the global scope, or call call it from the same local scope.

Changed it to this:

// For full API documentation, including code examples, visit Velo API Reference - Wix.com

import wixLocation from ‘wix-location’;
import wixWindow from ‘wix-window’;

$w.onReady( function () {
//TODO: write your page related code here…

let query = wixLocation.query;
wixWindow.openLightBox(‘ICARIS’, {‘message’:query});
});

Still the same error

You have a spelling error. it should be: wixWindow.openLightbox

Thanks for this, it is opening, but not displaying the message.

You have to retrieve the message using code. Look at the Api documentation

I am doing this in the code with the query parameter:

let query = wixLocation.query;

wixWindow.openLightBox(‘ICARIS’, {‘message’:query}); });

Query should be the location of the query part of my page

As I said, you also need some code on the light box side

Thanks for the help, but can you provide me with the code? All I am trying to do is display the query part of the URL in a box on my wix site.

See here:
https://www.wix.com/corvid/reference/wix-window.lightbox.html#getContext
Then after you receive the object assign its message value to a textbox on the ligthbox.

This tutorial shows an example on how to pass information to a lightbox (keep in mind that the scenario is a bit different than how you are setring up your code, bit it should still help you to understand how to build your code. Obviously do not copy it exactly since you are not using repeaters.):

https://support.totallycodable.com/en/article/open-a-lightbox-when-clicking-an-item-in-a-repeater-using-a-button

Both these examples are over complicated. I do not need a dataset, just the page to pop up the message with the query part of a URL. Anyone can provide the code rather than tutorials?

JD already gave you the code. The code is in the API guide written by Wix. Then I gave you a link to an example that uses that code to help you umderstand the concept behind the code.

If you don’t understand the code provided by Wix, then you always have the option to hire someone to do it for you or walk you through it.

Now, looking at your code above … it looks to be correct …but you only shared you code for your page …you have not shared your code for your lightbox. If you don’t have code on your lightbox (like the examples in the 2 links previosuly shared) then your work is incomplete.