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...
How to implement a page views counter in Sinatra and Ruby?   I have tried the @@ variables but they reset to zero whenever the page is loaded...  Like this one: http://148.251.142.233:8080/  Thanks!...
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...
Sinatra-websocket has been installed on my Ubuntu system, and can be used to communicate with a JavaScript client in a browser using a text string.   Since it works for text, I want to transfer some binary data from a JavaScript client in the browser...
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'm sending an object from Javascript to a Sinatra POST route. I'm using the 'stringify' method to convert my js object to JSON. The JSON being sent is like so (according to the dev tools in chrome):  {"a":1,"b":2,"...

Tags

Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.