Posts Tagged: Programming


24
Mar 10

Ruby Shortcuts

You often see the Array shortcut in code…

%w(foo bar sed)  # => ["foo", "bar", "sed"]

…but how many of the other Ruby Shortcuts are you aware of? Personally I knew about half of them.


8
Mar 10

Javascript Error: submit is not a function

I ran into an annoying namespace issue with JavaScript. When trying to submit() a form I received a “submit is not a function” error. Simply put the error occurs because your form has a element in it with the id of submit.

In my case it was my submit button.

<input type="submit" name="submit" id="submit" value="Go" />

Changing the id (and name) resolved the issue.

<input type="submit" name="go" id="go" value="Go" />