I want to cover a basic but essential part of what you might expect in an introduction to JavaScript. This post is only Part I of fuller explanation of JavaScript function scoping, "lexical scoping," and Javascript's hoisting behavior.

Although it may seem tedious to review fundamental elements of JavaScript, these are the building blocks for a comprehensive understanding of the language's functional style, which I will get to in Parts 2 and 3 of this introduction.

Oct 202011

http://www.charlesproxy.com/buy/

There is an IE 6 / IE 7 (only) bug that causes the content to spill out over the rest of the page. (The scroll bar appears, but the part of the scrolling content that should be "hidden" is spilling out onto the rest of the page where it shouldn't be visible. It does, actually scroll)

The jPlayer library for playing videos is very good and well documented http://jplayer.org/latest/developer-guide/, so I won't repeat what it has to say. jPlayer is an excellent tool for creating a video player – what you need is one of each kind of format, flash and non-flash, for full multi-platform support. (Essentially, a flash file and a mp4 file.)

However, I would like to point out the invaluable setting for errorAlerts (see http://jplayer.org/latest/developer-guide/#jPlayer-option-errorAlerts) which will alert you as to what is wrong if your video fails to play.

When a website that is running locally tries to access a remote web service.

XMLHttpRequest cannot load Origin http://127.0.0.1 is not allowed by Access-Control-Allow-Origin.

To disable this security restriction in Mac Chrome

open -b com.google.chrome --args --disable-web-security

See also:

http://www.nczonline.net/blog/2010/05/25/cross-domain-ajax-with-cross-origin-resource-sharing/

add to your Gemfile

group :development, :test do
 gem 'rspec-rails'
end

Be sure to bundle install after changing your Gemfile

rails generate rspec:install

Ran into an annoying chicken/egg involving deploying to Heroku with a shared database. It seems that Heroku isn't happy unless you have gem 'pg' in your Gemfile. If you are using the shared database and fail to have gem 'pg' in your Gemfile, you app actually deploys OK on Heroku but then generates an Application Error when you call a page. If you check the heroku logs you see something like this:

cd ~/Library/Application Support/TextMate/Bundles

git clone git://github.com/subtleGradient/javascript-tools.tmbundle.git

In Textmate, Bundles > Bundle Editor > Reload bundles

Now open a Javascript file and to Control-Shift V and choose "JSLint"

Also install Node.js
https://github.com/joyent/node/wiki/Installation

(Mac user can install using this package: https://sites.google.com/site/nodejsmacosx/)

A bit today about setting up and debugging Capybara with truncated fixtures. Capybara comes with an array of choices for a driver, the thing that actually runs your tests. You can emulate a user using a real browser (Firefox or Sarari), or you can emulate a headless browser.

Today I'm going to be focusing on setting this up with Selenium to have Firefox run your tests.

In IE7 to use the developer tools you must install IE Developer Toolbar, then to open it go here:

Tools (on the right-hand side) > Toolbars > Explorer Bar > IE Developer Tools

(This is so hard to find I had to make a picture)

In IE7 and IE8, you may wish to take important note of two buttons on the developer tools window.

© 2012 Tech Notes Suffusion theme by Sayontan Sinha