0

I m using iframe to open another webservice. there user can view the complete the nav of the targeted link. but i wan't to prevent the user to view the complete nav.

There are five items in the targetd URL like this:

  1. Overview
  2. Call Log
  3. Terrif
  4. Payment
  5. Logout

    <iframe id="subframe" frameborder="0" scrolling="no" src="login.aspx" style="float: left;height: 754px; margin-left: 118px;  width: 727px;"  ></iframe>
    

Now what i want is that, allow user only to view the Call Log.

How could be this possible to do?

Which steps could be taken to perform these all?

user2504141
  • 67
  • 3
  • 11

2 Answers2

1

If the service is on your own domain, you can access the frames DOM like so:

var myFrame = frames["myFrame"]

var cssLink = document.createElement("link") 
cssLink.href = "iframeStyles.css"; /* change this to the url for a stylesheet targetting the iframe */
cssLink .rel = "stylesheet"; 
cssLink .type = "text/css"; 
frames['myFrame'].document.body.appendChild(cssLink);

Also see this question: How to add CSS class and control elements inside of the Iframe using javaScript.?

If the iframe loads a page from another domain, you may not alter it, because that would be against the same origin policy.

Community
  • 1
  • 1
user1721135
  • 6,864
  • 8
  • 34
  • 63
0

I used this a couple of months before.. Some edits might be required:

<div id="IframeWrapper">
<div id="iframeBlocker">
</div>
<iframe id="mainframe" src="http://www.xyz.com/"></iframe>
</div>  

CSS:-

#IframeWrapper
{
    position: relative;
}

#iframeBlocker
{
    position: absolute;
    top: 0;
    left: 0;
    width: 700px;
    height: 450px;
}

#mainframe
{
    overflow: hidden;
    border-width: 0px;
}  

OTHER ALTERNATE AND A BETTER ONE

Bhavik
  • 4,836
  • 3
  • 30
  • 45
  • is there any mean to upload an image because only users having at least 10 reputation can load the image. – user2504141 Jun 20 '13 at 08:04
  • I don't think so.. Try the link I have given in the answer.. There is a list of new attributes for IFRAME in html5.. otherwise above it is an old css trick which disables all links.. – Bhavik Jun 20 '13 at 08:08