How do you open in appinventor url that use JS?

You could try running it with the webviewextra extension if you want to stick with the webviewer, or switch to using CustomWebview extension, and see how you get on.