# Javascriptlets- Execute a SmartObject in Designer.js

> Source: <https://gist.github.com/markman623/5c6e71bb1fb30a41853d6373dfc256b8>
> Published: 2024-06-25 14:51:30+00:00

Javascriptlets- Execute a SmartObject in Designer.js

      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      
Learn more about bidirectional Unicode characters

 
    Show hidden characters

javascript: ( function(){

    /*What you want to do goes here */

    alert(window.location);

})();

For SmartObject execution:

javascript:(function(){  

    let urlParams = new URLSearchParams(window.location.hash);

    $(".lyt-explorer-maincontent").after('<div><a onclick="$(this).parent().remove()">close</a><br/><iframe src="'

     + window.location.origin +  '/Management/Runtime/Form.aspx?_ID=2ae83f85-6336-49f1-a9e5-fe78b220f6c4&smartobjectguid=' 

     + urlParams.get("guid") + '"  height="400px" width="100%"></iframe></div>' );

})();
