Create script tag and call a method from an outer js file