How to hide an iframe url in HTML source code.I have two applications one applications get an url of another application into its iFrame,so that it displays in its source code.I dont want to display another application url in the source code.
+1
A:
You can't hide it per say, but you can run it through something like TinyURL so that anyone interested would need to go an extra step. Anyway, that's the only thing I can think of. However, if you are displaying that page in a frame, what's the harm in having the URL in the source code? There really isn't a good, foolproof way to prevent someone determined from finding out the location of that iframe page.
TNi
2010-07-08 19:49:10
+2
A:
I think you would need to set the IFRAME URL via JavaScript. The Javascript could then be Obfuscated, so that the URL would not be in plain text... Please see the following link for the obfuscator:
http://www.javascriptobfuscator.com/Default.aspx
i.e. if it was jQuery...
$("#myiFrame").attr('src','http://www.google.com');
becomes:
var _0xc1cb=["\x73\x72\x63","\x68\x74\x74\x70\x3A\x2F\x2F\x77\x77\x77\x2E\x67\x6F\x6F\x67\x6C\x65\x2E\x63\x6F\x6D","\x61\x74\x74\x72","\x23\x6D\x79\x69\x46\x72\x61\x6D\x65"];$(_0xc1cb[3])[_0xc1cb[2]](_0xc1cb[0],_0xc1cb[1]);
Fosco
2010-07-08 19:49:32
That's a good idea, but it would be possible to figure out where the link eventually goes using something like FireBug or the developer tools that ship with many browsers. Do the obfuscation, but also consider making the 'secret' link require a special key that only functions within the session or only for the user, etc.
Evan
2010-07-08 19:56:06
Right. The problem with this sort of obfuscation is that anyone even reasonably determined should be able to crack it. However, it is an extra step, if JavaScript is enabled.
TNi
2010-07-08 19:58:54