!!! 5
%html
%head
%script{:type => "text/javascript", :src => "/jquery-1.8.2.js"}
:javascript
function show(title,element,uri) {
$(element).html("
"+title+"
"+"Retrieving data from PubChem. This may take some time, please be patient."+"");
$.ajax({
cache: true,
url: uri,
success: function(data){
data = ""+title+"
"+"" + data;
$(element).html(data);
},
error: function(data,textStatus,message){
$(element).html(message);
}
});
}
function hide(title,element,uri) {
data = ""+title+"
"+"";
$(element).html(data);
}
function display(element,uri) {
$(element).html("Retrieving data from PubChem. This may take some time, please be patient."+"");
$.ajax({
cache: true,
url: uri,
success: function(data){
$(element).html(data);
},
error: function(data,textStatus,message){
$(element).html(message);
}
});
}
%body
%h1 PubChem read across
%form{:name => "form", :action => '/search', :method => "GET"}
%fieldset
%label{:for => 'name'} Compound name:
%input{:type => 'text', :name => 'name', :id => 'name'}
%input{ :type => "submit", :value => "Search" }
= yield