IF AN EXPERT SAYS IT CAN'T BE DONE GET ANOTHER EXPERT.- DAVID BEN-GURION

Using Iframes and Cross Domain Scripting

So I didn't write for a long time, and its about time to do that. I`v
few subjects to talk about, but today I will share my thoughts about
iframes and cross domain scripting.

Iframe is
an old HTML element which lets you load another page inside your current
page. People say that iframes are old and useless for us, but I think
they wrong.

Why?

Sometimes we want to make things that seems impossible because of our
browsers security rules. There are lots of guides and tutorials about
cross domain scripting, and seems that some very good implementation in
few well known projects:

You may try and view those products source code, and... if you have
enough skill, and I`m sure you do, you will notice that they are using
lots of ways to bypass cross domain scripting while trying to be as safe
as they can.

So the idea is to allow our customers to use our product while they
don't need to understand any programming code.The customers will just
have to add a piece of our code to their website and we will be able to
control it without any dependency on our customer. Lets just view some
examples:

Lets pretend that Facebook and Google are trying to create some kind of
chat integration. Facebook finally understood that GTalk is better then
Facebook Chat and they want to use GTalk instead.

Before we start make sure you have some kind of web server on your
computer \ remote web server.

As you may see, we are loading JavaScript file named "init.js"
from google1.com. This file will be our gate to use GTalk.
Note: you don't really need init.jsfile, and you can use your
own implementation, but for my example, I will show it to you:

//window.gtalk.init was created on our parent page (facebook1.com/facebook.com.html)
window.gtalk.init({async:'false',url:".google1.com/frames/message.js"});
window.gtalk.init({async:'true',url:".google1.com/frames/gtalk.js"});

Same like in Facebook, I`m loading two more files, this is
not performance wise and its only for this example.I guess that 'in
the real world' I would create some server side script that will merge
my files and use Google
Closure
or any other JavaScript compiler.