Answer the question
In order to leave comments, you need to log in
All javascripts were cloned, some kind of darkness went on (what did I do wrong?
I wanted to load ajax block.
This is where my nightmares started.
$ ->
frame_d=$('div#frame_d.load')
$("document").ready ->
$.ajax
type: "GET",
url: frame_d.attr("src")
dataType: "html"
error: (jqXHR, textStatus, errorThrown) ->
$('body').append "AJAX Error: #{textStatus}"
success: (data, textStatus, jqXHR) ->
frame_d.html(data)
frame_d.removeClass("load")
Answer the question
In order to leave comments, you need to log in
And if frame_d.removeClass is done before frame_d.html?
my fail, sorry.
Although it says
5.2 Page Change Events
When writing CoffeeScript, you'll often want to do some sort of processing upon page load. With jQuery, you'd write something like this:
$(document).ready ->
alert "page has loaded!"
However, because Turbolinks overrides the normal page loading process, the event that this relies on will not be fired. If you have code that looks like this, you must change your code to do this instead:
$(document).on "page:change", ->
alert "page has loaded!"
What is better to enjoy another event. I just loaded the layout every time. In the end it's such a mess.
render layout: false set and everything is cool
My fake
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question