0
votes

I have page on my SharePoint site that has toolbar (call it toolbar page). All items/elements in that toolbar are actually links to offsite locations, that are not on SharePoint at all.

Toolbar page consists of two web parts both content editor web parts, one where toolbar is and the other where I intended to put iframe code. To be more clear, I want to see off-SP pages on my Toolbar page when I click on any element in toolbar but to still stay on same toolbar page (just to get web part load off-SP pages).

Example: Toolbar:

<ul>
 <li class='has-sub'><a href='#'>Item 1</a>
  <ul>
   <li><a href='#'><span>Product 1</span></a></li>
   <li><a href='#'><span>Product 2</span></a></li>
  </ul>
 </li>
</ul>

iframe web part:

<script type="text/javascript">
  function Navigate(file) {
    document.getElementById('iframe1').src=file;
  }
</script>
<iframe name="iframe1" id=iframe1 src="homepage link" width="1280px" height="1024px" scrolling="auto">
</iframe>

So my question is, can this code be edited so page can work correctly or what should I do to make it work? Any suggestion and help is greatly appreciated.

1

1 Answers

0
votes

I finally found solution for this one.
In a tags person should just put target="optional word exp. MyFrame" after a href="#".
So it should look like this
<a href="#" target="MyFrame">

In iframe part of code just put
<iframe name="MyFrame" src="#"></iframe>