How to load login, register and other forms and nodes in modal window?
No need to write single line of code.

To open node add/edit form in modal window, try below modules

https://www.drupal.org/project/ctools_automodal
https://www.drupal.org/project/ctools_automodal_admin

I tried &amp; it works properly for me.

To open node add form in modal
admin/config/system/ctools_automodal_admin -> Modal content types and select content types.

To open node edit form in modal add
node/%node/edit in Extra modal links textarea.