Anyone know how to get a client script to run in a...
# suitescript
j
Anyone know how to get a client script to run in an inlinehtml Portlet? I noticed you can’t import a module in the inline html portlet version and NetSuite seems to strip out any script tags I put in the html so this doesn’t even work:
Copy code
define([], function () {
  var render = function (ctx) {
    var portlet = ctx.portlet;
    var html = "\n<!DOCTYPE html>";
    html += "\n<html>";
    html += "\n<body>";
    html += "\n<button type=\"button\" onclick=\"clickMe()\">Click Me!</button>"; // <- clickMe not found..
    html += "\n<script>";
    html += "\nfunction clickMe() {";
    html += "\n  alert('Hello World');"
    html += "\n}";
    html += "\n</script>";
    html += "\n</body>";
    html += "\n</html>\n";
    portlet.html = html;
  };
  return { render: render };
});