Biojs.EbiGlobalSearch showcase
PLEASE NOTE: the above example is being affected by the CSS rules of this site. Click on 'view in window' to see the component by using its own CSS stylesheet(s) only.
View in windowOverview
EBI Global Search
Version
1.0.0.
To get the above Biojs.EbiGlobalSearch to work on your page, you need to do the following:
- Include the file Biojs.EbiGlobalSearch.js and its dependencies to your page header.
Biojs scripts
<script language="JavaScript" type="text/javascript" src="src/Biojs.js">
External script(s)
<script language="JavaScript" type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js">
CSS stylesheet(s)
<link rel="stylesheet" href="//www.ebi.ac.uk/web_guidelines/css/compliance/develop/ebi-visual.css" type="text/css" />
- Create a div tag which holds an unique identifier.
<body> ... <div id="YourOwnDivId" /> ... </body> - Create a code snippet within a <script> tag and instance Biojs.EbiGlobalSearch into.
window.onload = function() { var instance = new Biojs.EbiGlobalSearch({ target: 'YourOwnDivId', query: 'p53', searchBaseURL: 'http://www.ebi.ac.uk/ebisearch/', style: 'collapsible' // basic | collapsible | expanded }); };
Required Parameters
-
target | {string}
Identifier of the DIV tag where the component should be displayed
-
query | {string}
[query='keratin'] Query to retrieve EBI search results
Optional Parameters
-
searchBaseURL | {string}
Base URL of the REST service which provides the data
Default: 'www.ebi.ac.uk/ebisearch/' -
style | {string}
Pptions to display this component: basic, collapsible or expanded
Default: 'basic'
setQuery
Set query for the service.
Parameters:
-
{string} query
Query. -
{string} style
Style: 'basic', 'collapsible' or 'expanded'.
Example 1:
instance.setQuery("ENSG00000100867");
Example 2:
instance.setQuery("Q61171");
Example 3:
instance.setQuery("actin");
Example 4:
instance.setQuery("keratinnn");
setStyle
Test styles for the service.
Parameters:
-
{string} style
Style: 'basic', 'collapsible' or 'expanded'.
Example 1:
instance.setStyle('basic');
Example 2:
instance.setStyle('collapsible');
Example 3:
instance.setStyle('expanded');
onError
Parameters:
-
{function} actionPerformed
A function which receives an Biojs.Event object as argument.
Returned data in the Biojs.Event object:
-
{string}
message
Error message in case of result be 'failure'.
Example :
instance.onError(
function( e ) {
alert( e.message );
}
);
onResults
Parameters:
-
{function} actionPerformed
A function which receives an Biojs.Event object as argument.
Returned data in the Biojs.Event object:
-
{int}
resutls
Number of total results. -
{int}
items
Number of items.
Example :
instance.onResults(
function( objEvent ) {
alert( objEvent.resutls + " results for " + objEvent.servicesWithResults + " services of " + objEvent.services + " services queried" );
}
);

