Tuesday, January 31, 2012

Same origin policy

I have been fighting the same origin policy too much today.  This article from wikipedia sums it up really well.  I'm really surprised in all the googling I've done that not many people mention document.domain.  I've seen document.domain before, but I have not run into it in a while and forgot!

I've tried iframes, AJAX, code behind, and even looked at the proxy solution.  I still don't have a great solution, but I think I may try to implement the document.domain solution.  The problem is I will have to go edit potentially thousands of existing HTML files to add it.  I suppose I can script it.

One other thing that prevented code-behind from working is that it's an https connection with an invalid security certificate.  I should also mention that this is all internal intranet stuff.

If you google document.domain, the one thing you may miss is that even if you set the same document.domain on different files, the protocol matters.  That means they both need to be http or https.  No mix and match.

Thursday, January 26, 2012

Tuesday, January 17, 2012

Javascript Delete

Wow.  I don't have time to read this article about javascript delete, but I need to go back to it.

Read dojo source for better design

Quick note.  Thanks @dojo for being open source!  I've been learning a lot of good style from reading the source.

Tutorial 1 - HTML5

So I found this random guy at the new boston who does training videos.  The videos are pretty informal, but they are nice and short.  I did a few of his HTML5 tutorials.

Also I took a look at this sweet pure HTML5 app which works on the ipad and the net.

Then HTML5 graceful degradation.

I think I have only scratched the surface.

My New Years Resolution

My New Years resolution this year is two fold.

1. Ask more questions and be an attentive listener.  I've gotten good at tuning things out.  (Think long conference calls where you are pretty much listen only)

2.  Tutorials.  This is the big one.  I am going to do a tutorial every other week.  Not CREATE a tutorial on this blog, but go find one and do it.  Things I want to get better at:

  1. HTML5
  2. Spring
  3. AJAX
  4. REST
  5. CouchDB
  6. Ruby on Rails
  7. Java
  8. Eclipse
  9. Groovy Grails
  10. Hibernate
  11. Aspect J, JSPX
  12. I'm sure there is other stuff ... I'll come back and update this list.

Monday, January 9, 2012

Ssh Passwordless Authentication

I got this to work today.  I had an issue using the same "local" user ID on both systems.  I think ssh must have gotten confused at to which lilly-boy I was talking about.  Anyway, it worked great with different user ID's which is what I was going to do for prod anyway:


Thursday, January 5, 2012

Dojo 1.7 / ADM / Performance

This is really nice.  I have been using dojo 1.6 for 6 months now.  I'm not using a CDN, so I'm serving the dojo toolkit from my web server.  It's a really small project, so I never set up a "build", but with dojo 1.7, I don't think I will need to.  The new AMD Loader will only load the dojo code that I need.  Sweet.  And it manages name conflicts so you can easily use other javascript frameworks.  Nice.

EDIT: I've now ported my project pretty easily to dojo 1.7 using a CDN.  Now I'm trying to use the define and require syntax to make my modules work with asynchronous modules (ADM).  I'm also using namespace.js, but I don't know if it is really needed now.

EDIT 2:  I had some "global" style javascript functions and variables.  Now I have converted everything to ADM.  There was some good re-factoring going on.  I still have some tightly coupled modules, but at least most of my modules are self contained and reusable.  So the re-factoring for dojo 1.7 ADM loader was nice, but I did not get the performance gains I was expecting.  I am now looking at downloading the SDK and doing a build to minify/concat to get better performance.

I ripped out namespace.js.  I didn't see a need for it anymore with the ADM modules.  Also I should note that the port to dojo 1.7 was easy.  The port to ADM loader was not, but I have much more OO code now which is good.