Yngve's code
Blog posts about code, school, work, life etc.
Sunday, August 5, 2012
jQuery
So I changed templates, and that caused jQuery to disappear. Fortunately, adding it again is of course as easy as changing templates was, all I did was load up the template source and add the following line right after the opening
tag:At first I added it right before the closing body tag as I read somewhere that was considered best practice, but that obviously didn't work since the scripts I add in each post are executed before the browser reaches that point. So if I want to be able to put jQuery in my posts, I have to load it somewhere before the element with the id "main", which is where Google puts posts (I think).
Having Google host jQuery makes life so much easier. I only wonder if getting underscore.js will be as simple; because I don't think Google hosts that too.
CSS shit
Yeah, right now I'm working on a pretty shitty problem. I'm trying to make the style for a block of code that I can use here in this blog. However, the overflow-x property doesn't seem to be working correctly. I try to set it to overflow-x: auto, but it still breaks the text. Here is the style (in the code block itself):
And here is a test that shows it breaks lines (the text is a single line which contains no linebreaks):
scripttest
Something on this blog uses jQuery, because I certainly didn't load it. Maybe I'll inspect the source and see if I can spot where it comes from. I wish underscore.js was here as well though, I love that library. Although it isn't too important for a small test like this. Underscore is more useful at work, where we deal with tables and lists of dicts and lists and objects and so on.
