Custom HTML windows.close() cannot use

Confluence User - 12 Oct, 2018

Hi

Am trying to close current window from customHTML Java script. But this code makes my editor window close on loading.

Is any solution to prevent executing js in editor forms?

<script>
      $(document).ready(function(){
        $("#submit").hide();
        var refresh="#requestParam.isRefresh#";
        if(refresh=="yes"){
            $("#submit").click();
        }else{
            console.log("no");
            window.close();// This one closes editor window
        }
      });
</script>
forms;customhtml;close

1


14 Oct, 2018
confluenceUser
confluenceUser

Hi, if you are using custom code to close the window, why not check for the existence of the editor window first? Use the browser developer tool to inspect and find the id or class of the editor window.

RELATED QUESTIONS

Your answer


To answer a question you'll need an account.

Print