Is there a way to create and run javascript in Chrome?

后端 未结 9 2222
生来不讨喜
生来不讨喜 2020-12-13 06:21

Is there a way, like an extension or application, in Chrome to create and run .js files in Chrome?

9条回答
  •  南笙
    南笙 (楼主)
    2020-12-13 07:16

    You can also open your js file path in the chrome browser which will only display text.

    However you can dynamically create the page by including:

    var script = document.createElement('script');
    script.type = 'text/javascript';
    script.src = 'myjs.js';
    document.head.appendChild(script);
    

    Now you can have access to the js variables and functions in the console.

    Now when you explore the elements it should have included.

    So not i guess you dont need a html file.

提交回复
热议问题