I'm trying to call a widget inside my JS function to print out actions that would apply to transferable game items (basically moving an item from one container to the other). This would solve a problem to which I find no work around at the moment in sugarcube and it would allow me to stream line moving items from containers to other containers and between NPC characters and the player (later on I would want to turn my containers into objects with their own names, inventory, size, etc.).
var $list = $(document.createDocumentFragment());
$list.append('<<transferContainerItemToPlayer' +' $' + container_name + '\"' + item.id + '\"' + ">>").append('<br>');
Widget code that I'm trying to call from "InventoryManagmentWidgets" passage ("widget" tag has been defined in this passage).
Now, what I get is something like this:
When I tried escaping the '<' character and '>' character respectively I ended up with the same results.
Is there any way to call widgets defined in a passage and calling it somehow with arguments?
Thank you for your help in advance!