28 lines
961 B
JavaScript
28 lines
961 B
JavaScript
window.addEventListener('load', () => {
|
|
reapirsearch();
|
|
})
|
|
function reapirsearch(){
|
|
console.log('seacrh red');
|
|
var param =new URLSearchParams(window.location.search);
|
|
var itemid= param.get('Itemid');
|
|
console.log('seacrh red'+itemid);
|
|
|
|
document.querySelectorAll('.com-finder__form form input').forEach(inp => {
|
|
|
|
inp.setAttribute('value',itemid);
|
|
|
|
})
|
|
|
|
document.querySelector('.com-finder__form form').setAttribute('action','/component/finder/search?Itemid='+itemid);
|
|
var newhref= document.querySelector('.com-finder__explained a').getAttribute('href').slice(0,-3);
|
|
document.querySelector(' .com-finder__explained a').setAttribute('href',newhref+itemid);
|
|
document.querySelectorAll('form input').forEach(ins => {
|
|
var ins1= ins.getAttribute('name');
|
|
if(ins1=='f'){
|
|
ins.remove();
|
|
}
|
|
})
|
|
document.querySelector(' .query-required a').setAttribute('href','/component/finder/search?Itemid='+itemid);
|
|
|
|
|
|
} |