How to: Debug Browser Preview

For a JS project, there may be something wrong with preview effect after clicking “Run in browser”. There are two ways to solve this problem.

1 Drop the scene files used in the current browser to the list of JS projects src/resource.js. For example,

Original resource.js:

image

Modified resources. js:

image

Add the resources of current scene to g_resources=[…].

2 Enable “developer tool”, find the bug according to log.

Chrome

Customize and control Google Chrome -> More tools -> Developer tools

image

360 Browser

Tools -> Developer Tools:

Firefox

Settings -> Developer -> Browser Console -> JS

image image

image


扫描二维码或在微信中搜索 KeepMovingXin
欢迎关注微信公众号!