If I create an iframe
like this:
var dialog = $(\'
Since the solution wasn't really mentioned for the server side:
One has to set things like this (example from apache), this isn't the best option as it allows in everything, but after you see your server working correctly you can easily change the settings.
Header set Access-Control-Allow-Origin "*"
Header set X-Frame-Options "allow-from *"