Monday, September 8, 2008

Prevent site from IFRAME

Sometime it is neccessary to prevent site or perticular page opening in IFRAME. To do that use following code in page or site. (Someway every page on site).

<script language="javascript">
if(top != self)
top.location = self.location;

If some page written above code and still you want to open that page in IFRAME. You need to use following syntax. This is only supported in IE.

<iframe src="write your url that contain above code." width="500" Height="500" security="restricted">

If any one have firefox solution for this please inform me.

No comments: