Solved

open link in inline frame when you work in div

Posted on 2010-09-05
9
298 Views
Last Modified: 2012-05-10
hello,

i want to open a link in an inline frame

http://www.body-combat.net/v4/nl/tracklist.php

when i klick on an image, a new page underneath has to load.

my code is in a div, and opens each time a new window....

can someone help me? thx




<div id="scrollable" class="style27" style="left: 0px; top: -1px; width: 680px;">

    					<div class="navi"><p></p></div>

    					<a class="prev"></a>

    								<div class="items">

    								<a href="http://www.google.be" target="I1">est</a>

    					        					<a href="http://www.google.be" target="I1"><img src="http://www.body-combat.net/v4/images/BODYCOMBAT44.png" alt="text1" title="text2" width="130" height="176" /><span class="style26">bc 

													44</span></a>

													<a href="" target="I1"><img src="http://www.body-combat.net/v4/images/BodyCombat-43.png" alt="text1" title="text2" width="130" height="176" /><span class="style26">bc 

													43</span></a>

													<a href="" target="I1"><img src="http://www.body-combat.net/v4/images/bc42.png" alt="text1" title="text2" width="130" height="176" /><span class="style26">bc 

													42</span></a>

    					        					<a href="http://www.body-combat.net/tracklist/tracklist_body_combat_41.htm" target="I1"><img src="http://www.body-combat.net/images/bc_41_flyer.bmp" alt="text1" title="text2" width="130" height="176" /><span class="style26">bc 

													41</span></a>

													<a href="http://www.body-combat.net/tracklist/tracklist_body_combat_40.htm" target="I1"><img src="http://www.body-combat.net/images/bc40.jpg" alt="" title="" width="130" height="176" /><span class="style26">bc 

													40</span></a>

        				        					<a href="http://www.body-combat.net/tracklist/tracklist_body_combat_39.htm" target="I1"><img src="http://www.body-combat.net/images/BC_39_poster.jpg" alt="" title="" width="130" height="176" /><span class="style26">bc 

													39</span></a>

        				        					<a href="" target="I1"><img src="http://www.body-combat.net/images/flyer_release_38.jpg" alt="" title="" width="130" height="176" /><span class="style26">bc 

													38</span></a>

        				        					<a href="" target="I1"><img src="http://www.body-combat.net/images/bc_flyer_37_new.jpg" alt="" title="" width="130" height="176" /><span class="style26">bc 

													37</span></a>

        				        					<a href="" target="I1"><img src="http://www.body-combat.net/images/bc_36.PNG" alt="" title="" width="130" height="176" /><span class="style26">bc 

													36</span></a>

        				        					<a href="" target="I1"><img src="http://www.body-combat.net/images/NovemberBodyCombat.jpg" alt="text1" title="text2" width="130" height="176" /><span class="style26">bc 

													35</span></a>

													<a href="" target="I1"><img src="http://www.body-combat.net/images/bc_34.jpg" alt="" title="" width="130" height="176" /><span class="style26">bc 

													34</span></a>

													<a href="" target="I1">

													<span class="style26">bc 43</span></a>

        				        	</div>

Open in new window

0
Comment
Question by:fedkris
  • 5
9 Comments
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 33606722
How have you applied the target attribute to the iframe?
0
 

Author Comment

by:fedkris
ID: 33606744

<td style="width: 764px">



<iframe id="I1" border="0" frameborder="0" name="I1" scrolling="no" style="width: 748px; height: 365px">

Your browser does not support inline frames or is currently configured not to display inline frames.

</iframe>



</td>

Open in new window

0
 
LVL 108

Assisted Solution

by:Ray Paseur
Ray Paseur earned 500 total points
ID: 33606903
Hmm... Not sure I understand what is wrong, but I can show you a teaching example of how to use iFrames in PHP and HTML.  Two scripts follow...

This is the script that runs the contents of the iframes.
<?php // RAY_iframe.php
error_reporting(E_ALL);

if (empty($_GET['n']))
{
    echo "NO IFRAME NUMBER SELECTED<br/>";
    die();
}

// WRITE SOME HTML INTO THE FRAMES
if ($_GET['n'] == '1')
{
    echo "SELECTED IFRAME NUMBER ONE<br/>";
    die();
}

if ($_GET['n'] == '2')
{
    echo "SELECTED IFRAME NUMBER TWO<br/>";
    die();
}

// SHOW THE SOURCE CODE FOR THIS SCRIPT
if ($_GET['n'] == '3')
{
    highlight_file(__FILE__);
    die();
}

Open in new window

0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 108

Accepted Solution

by:
Ray Paseur earned 500 total points
ID: 33606907
This is the HTML page that contains the iframes.

HTH, ~Ray
<?php // RAY_iframe.html ?>

<a target="frame_number_one" href="http://www.laprbass.com/RAY_iframe.php?n=1">SET FRAME ONE</a><br/>
<a target="frame_number_one" href="http://www.laprbass.com/RAY_iframe.php">CLEAR FRAME ONE</a><br/>
<br/>
<a target="frame_number_two" href="http://www.laprbass.com/RAY_iframe.php?n=2">SET FRAME TWO</a><br/>
<a target="frame_number_two" href="http://www.laprbass.com/RAY_iframe.php">CLEAR FRAME TWO</a><br/>


<!-- PUT UP SOME HTML TO DEFINE THE IFRAMES -->
<iframe name="frame_number_one" src="http://www.laprbass.com/RAY_iframe.php">one</iframe>
<br clear="all" />
<iframe name="frame_number_two" src="http://www.laprbass.com/RAY_iframe.php">two</iframe>
<br clear="all" />

<!-- SHOW THE PHP SCRIPT THAT RUNS THE IFRAMES -->
<a href="http://www.laprbass.com/RAY_iframe.php?n=3">CLICK HERE</a>

Open in new window

0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 33956874
Wow, this thing has been hanging around for a month and a half and now you want to delete it without comment or response?  What did I do wrong?  I provided tested and working code samples showing you how to accomplish your objectives.  

The question was, "i want to open a link in an inline frame."  If you simply install the code snippet I posted here and run them you can see how that is done.  Or you can test them on my web site - the URLs should be obvious from the code snippets posted above.

For the most part, we cannot write your code for you - that is what a developer would get paid to do - but in this case the answers and the examples are exactly responsive to the question.

Best regards, ~Ray
0
 
LVL 108

Expert Comment

by:Ray Paseur
ID: 33967065
These answer it:
ID:33606903
ID:33606907
0
 

Expert Comment

by:_alias99
ID: 34028165
All,
 
Following an 'Objection' by Ray_Paseur (at http://www.experts-exchange.com/Q_26560120.html) to the intended closure of this question, it has been reviewed by at least one Moderator and is being closed as recommended by the Expert.
 
At this point I am going to re-start the auto-close procedure.
 
Thank you,
 
_alias99
Community Support Moderator
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
IFRAME in a ASPX file no longer working 3 27
Centered Image 2 23
Put shading on half of picture 8 28
How to write an English digest paper 6 25
Build an array called $myWeek which will hold the array elements Today, Yesterday and then builds up the rest of the week by the name of the day going back 1 week.   (CODE) (CODE) Then you just need to pass your date to the function. If i…
This article discusses four methods for overlaying images in a container on a web page
In this tutorial viewers will learn how to style a corner ribbon overlay for an image using CSS Create a new class by typing ".Ribbon":  Define the class' "display:" as "inline-block": Define its "position:" as "relative": Define its "overflow:" as …
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

27 Experts available now in Live!

Get 1:1 Help Now