0

I'm developing clientside application and i use middleman for this

And on my index page i have optional scripts that i add to the rest of the scripts at the bottom of body tag into final layout via content_for helper. (i call yield_content :js if content_for :js there)

And nothing happens.

Latest chrome and ff at ubuntu 1204 just ignore this script tags - nothing gets loaded and executed, and in chrome's dev tool src attr of script tag does not getting highlighted.

While identically the same scripts being added manually on same place work fine.

As i see it - this has something to do with streaming html to the browser (i'm not qualified in such things at all)

Any ideas guys?

Here is chunk from layout.erb:

<script src="js/libs/jquery.query-yql.js"></script>
<script src="js/libs/moment.min.js"></script>
<script src="js/libs/ru.js"></script>

<%= yield_content :js if content_for? :js%>

Here is what i get in chrome dev tool. I've intentionally kept hardcoded scripts (the top ones) so you can compare them to result of content_for - jquery.query-yql.js and moment.min.js:

Browser ignores script tag

idrozd
  • 145
  • 2
  • 10

1 Answers1

2

There is a slight typo in your yield content block, "scr" should be "src"

alexwen
  • 1,128
  • 7
  • 16