comman.js
var str = '我是好人'
document.getElementById('div').innerHTML = str //div 是页面的 div的id
然后在html页面同一个位置都给一个相同id的div
页面再引用这个js即可!
帮助到你请采纳,谢谢!
C:\Users\cutepig\AppData\Roaming\npm\node-gyp ->C:\Users\cutepig\AppData\Roaming\npm\node_modules\node-gyp\bin\node-gyp.js
node-gyp@3.3.1 C:\Users\cutepig\AppData\Roaming\npm\node_modules\node-gyp
├── graceful-fs@4.1.3
├── osenv@0.1.3 (os-tmpdir@1.0.1, os-homedir@1.0.1)
├── semver@5.1.0
├── nopt@3.0.6 (abbrev@1.0.7)
├── fstream@1.0.8 (inherits@2.0.1)
├── which@1.2.4 (isexe@1.1.2, is-absolute@0.1.7)
├── minimatch@1.0.0 (sigmund@1.0.1, lru-cache@2.7.3)
├── mkdirp@0.5.1 (minimist@0.0.8)
├── glob@4.5.3 (inherits@2.0.1, inflight@1.0.4, once@1.3.3, minimatch@2.0.10)
├── rimraf@2.5.2 (glob@7.0.3)
├── tar@2.2.1 (inherits@2.0.1, block-stream@0.0.8)
├── npmlog@2.0.2 (ansi@0.3.1, gauge@1.2.7, are-we-there-yet@1.0.6)
├── path-array@1.0.1 (array-index@1.0.0)
└── request@2.69.0 (is-typedarray@1.0.0, aws-sign2@0.6.0, forever-agent@0.6.1
, caseless@0.11.0, stringstream@0.0.5, tunnel-agent@0.4.2, oauth-sign@0.8.1, iss
tream@0.1.2, json-stringify-safe@5.0.1, extend@3.0.0, node-uuid@1.4.7, qs@6.0.2,
combined-stream@1.0.5, tough-cookie@2.2.1, mime-types@2.1.10, aws4@1.3.2, bl@1.
0.3, form-data@1.0.0-rc3, hawk@3.1.3, har-validator@2.0.6, http-signature@1.1.1)