test.json:
{"name":"hello"
} import myJson from './test.json'
console.log(myJson.name)
exe是可执行文件,可以用js打开,例子如下:function Run(strPath)
{
exe.value=strPath
try
{
var objShell=new ActiveXObject("wscript.shell")
objShell.Run(strPath)
objShell=null
}
catch(e)
{
alert(e)
}
}
</script>
请输入要运行的程序:<br/><input name=exe type=text size=20 value="regedit">
<BUTTON class=button onclick="Run(exe.value)">decide</BUTTON>
<BUTTON class=button onclick=exe.value="">input</BUTTON><br/>
<BUTTON class=button onclick="Run('notepad')">notepad</BUTTON><br/>
<BUTTON class=button onclick="Run('mspaint')">mspaint</BUTTON><br/>
<BUTTON class=button onclick="Run('calc')">calc</BUTTON><br/>
<BUTTON class=button onclick="Run('cmd')">cmd</BUTTON><br/>
<BUTTON class=button onclick="Run('Regedit')">Regedit</BUTTON><br/>
<BUTTON class=button onclick="Run('Msconfig')">Msconfig</BUTTON><br/>
<BUTTON class=button onclick="Run('file:///D:/EDI/PCstructure/bin/Debug/PCStructure.exe')">PC EXE</BUTTON><br/>
<BUTTON class=button onclick="Run('IEXPLORE.EXE')">IE</BUTTON><br/>
<BUTTON class=button onclick="Run('..')">..</BUTTON><br/>
<BUTTON class=button onclick="Run('%windir%')">%windir%</BUTTON><br/>