I have an ERB document:  <!DOCTYPE html>     <html>         <head>             <script>             scrollDown = function() {                document.body.scrollTop = document.body.scrollHeight;             }             </...
I've been wanting to try out the Accordion effect on mootools but I can't get it to work, it's just like the js doesn't load at all  this is the HTML code  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"  "http...
I am using inline haml templates in my sinatra app. I have a @@layout with a section like this:    #message   - if flash[:notice]     %section.notice= flash[:notice]   - if flash[:error]     %section.error= flash[:error]   When I use flash[:notice] =...
I am trying to embed the output of Ruby code in JavaScript:  var stuff= "<% Representative.get('http://0.0.0.0:4568/') %>";   The embedded part is working by itself showing a result like this:  { "name":"John Johnson...
I'm generally of the opinion that if it ain't broke don't fix it, but my current solution to this issue (though it does work) seems really ugly. I am using Ruby, Sinatra, Haml, and Highcharts, and I'd like to be able to pass data grab...
I want lineChart of Chart.js in my sinatra application. But firefox console says  `TypeError:this.scale is undefined(Chart.js:2686)`   and, lineChart is not displayed.I wrote following code.  @hello.erb  <html>     <head>         <scri...
I'm using twitter bootstrap. I want modal to be shown by clicking on a link using javascript.  $("#my-link-id").click($(this).modal());   However, the code above causes an error of  Uncaught Error: HIERARCHY_REQUEST_ERR: DOM Exception 3...
I have a Sinatra app which loads information from an external API and displays it on a page. This is done in Sinatra which gets the information and puts it a temporary model instance (which is NOT saved), so it is easier to access all its propertys i...
I'm using Sinatra. I've got a button that sends a JSON-formatted string to the server by making a POST request. Only problem is, the JSON string isn't getting to the server.  Here's index.erb:  <input id="post-button" type=...
I've been at this for a while, but am missing something. I've just set up a simple Sinatra app returning JSON:  get '/json' do   content_type :json   $data.to_json end   This is working fine, and then the javascript I'm using to d...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.