close button

5 replies · opened Apr 9, 2021

BbagginsApr 9, 2021

Hello,

Can you please provide link in canvas demo pages that shows example of a button closing current page?

TIA

SSemicolon WebSTAFFApr 9, 2021

Hello,

Apologies about the misunderstanding but we are not sure what you mean by this:
example of a button closing current page

Can you please provide us with an Example of what you are looking for so that we can provide you further assistance on this. Thanks for your Patience.

Meanwhile, do let us know if we can help you with anything else or if you find any further issues with Canvas.

SSemicolon WebSTAFFApr 10, 2021

Hello,

Canvas does not include any Default Code for this. You will need to use Custom JS Codes. Consider using these codes:
[ch_pre type="js"]var myWindow;

function openWin() {
myWindow = window.open("", "myWindow", "width=200,height=100");
myWindow.document.write("
This is 'myWindow'
");
}

function closeWin() {
myWindow.close();
}[/ch_pre]

Then you are using the following HTML Codes to Open/Close the Window:
[ch_pre]Open "myWindow"
Close "myWindow"[/ch_pre]

This should definitely work fine. Note that, you can close the Window that has also been opened by your JS Codes. Hope this Helps!

Let us know if we can help you with anything else or if you find any further issues.

BbagginsApr 10, 2021

Unfortunately, no the window is not opened by js code. Is there another way to close window tab without this requirement?

SSemicolon WebSTAFFApr 10, 2021

Hello,

Unfortunately, there is no other solution for this. The Custom JS will be blocked by the Browsers for security purposes.

Let us know if we can help you with anything else or if you find any further issues.

Have the same question, or something new?

Sign in to the Canvas dashboard to reply or open your own topic. Canvas owners get direct help from the SemiColonWeb team.

Reply on the dashboard
close button · Canvas Template Support