mirror of
https://github.com/fluencelabs/jsonpath
synced 2025-06-22 04:11:40 +00:00
README.md - update
This commit is contained in:
@ -45,4 +45,23 @@ function initEvent() {
|
||||
}
|
||||
}
|
||||
|
||||
initData('data/example.json').then(initEvent)
|
||||
function readPathParam() {
|
||||
let params = location.search.substr(1)
|
||||
.split('&')
|
||||
.map((item) => item.split('='))
|
||||
.reduce((acc, param) => {
|
||||
acc[param[0]] = decodeURIComponent(param[1]);
|
||||
return acc;
|
||||
}, {});
|
||||
|
||||
if(params.path) {
|
||||
getJsonpathInput().value = params.path;
|
||||
let doc = getReadBtn().ownerDocument;
|
||||
let event = doc.createEvent('MouseEvents');
|
||||
event.initEvent('click', true, true);
|
||||
event.synthetic = true;
|
||||
getReadBtn().dispatchEvent(event, true);
|
||||
}
|
||||
}
|
||||
|
||||
initData('data/example.json').then(initEvent).then(readPathParam);
|
Reference in New Issue
Block a user