JoseOwense
New Member
I'm very frustrated right now... and making lots of mistakes. Sorry about that
I've been trying to unhide a specific div based on search resultsIf no search was made the div should not appear, and this is easy with css, but once the search is done I have to change the style to 'block'.Since I'm using the google custom search javascript its too hard to replace the button for another similar button that triggers my javascript function.I also couldn't figure out how to replace the "resultDiv" into some more complex pathI already done this javascript function to hide a div based on the result div... css div style is at #main.section .widget.HTML\[code\]function check(){ if (document.getElementById('resultDiv')) { if ($('.gsc-expansionArea').is(":empty")) { document.getElementById('resultDiv').style.display = 'none'; } else { document.getElementById('resultDiv').style.display = 'block'; } } }\[/code\]I think there might be 2 possible solutions. First is to load the script \[code\]<body onLoad="check();"> \[/code\]but doesn't seems to work.Second would be check URL for ?q= meaning a search was done, but I don't know how to get these parameters from URL.Please assist me. Thank you
I've been trying to unhide a specific div based on search resultsIf no search was made the div should not appear, and this is easy with css, but once the search is done I have to change the style to 'block'.Since I'm using the google custom search javascript its too hard to replace the button for another similar button that triggers my javascript function.I also couldn't figure out how to replace the "resultDiv" into some more complex pathI already done this javascript function to hide a div based on the result div... css div style is at #main.section .widget.HTML\[code\]function check(){ if (document.getElementById('resultDiv')) { if ($('.gsc-expansionArea').is(":empty")) { document.getElementById('resultDiv').style.display = 'none'; } else { document.getElementById('resultDiv').style.display = 'block'; } } }\[/code\]I think there might be 2 possible solutions. First is to load the script \[code\]<body onLoad="check();"> \[/code\]but doesn't seems to work.Second would be check URL for ?q= meaning a search was done, but I don't know how to get these parameters from URL.Please assist me. Thank you