Webhelp classic auto open first result on right pane
Posted: Tue Jan 16, 2018 9:02 pm
Hi, I have a requirement to output Webhelp that allows the opening of the first result in the right pane of Webhelp classic.
For instance, we have an application that will invoke Webhelp with the searchQuery parameter ie /webhelp/index.html?searchQuery=print. We want the first result found in the searchresults to be displayed in the right pane.
I thought I could use webhelp.head.script and supply some jquery to do this. However, the search results don't seem to be loaded until after my code has already run. That even if I use the jquery $( document ).ready function. I've also tried attaching my code to webhelp.body.script
My code is very simple. I get the link associated with the first result, and then use it to change the iframe (#frm) on the right.
I don't see any other hooks that I could use to do this? Any suggestions?
For instance, we have an application that will invoke Webhelp with the searchQuery parameter ie /webhelp/index.html?searchQuery=print. We want the first result found in the searchresults to be displayed in the right pane.
I thought I could use webhelp.head.script and supply some jquery to do this. However, the search results don't seem to be loaded until after my code has already run. That even if I use the jquery $( document ).ready function. I've also tried attaching my code to webhelp.body.script
My code is very simple. I get the link associated with the first result, and then use it to change the iframe (#frm) on the right.
Code: Select all
$( document ).ready(function() {
s = $('#foundLink0');
href = $(s).attr('href')
var $iframe = $('#frm');
$iframe.attr('src', href );
})