Solved

pages loaded in iframe alter the main page history

Posted on 2003-12-10
4
435 Views
Last Modified: 2008-02-26
hello,
i have an iframe in which i load different sets of banners.... (html)
the banner page reloads itslef using a javascript settimeout function

its working perfectly, but what i noticed is that, when the user clicks on the back button, of the browser, or when he clicks the refresh button, actually its the iframe that get the command...(which will go back to the previous ad, or refresh the current one...)

how can i do this...

i am using an <iframe name="dany"></iframe>

then from a javascript inside the main page, i am changing the location of the iframe.

any suggestions?

thanks
Dan
0
Comment
Question by:Dany Balian
  • 2
  • 2
4 Comments
 
LVL 16

Expert Comment

by:jaysolomon
ID: 9915320
one way is to use a div instead of an iframe and use your JS function in the "main" page to set the innerHTML of the div, or change the image src.
0
 
LVL 11

Author Comment

by:Dany Balian
ID: 9915722
yeah man great idea...
but the problem is that with inner html i cannot load flash objects
i tried that, and i was able to rotate images, text, hyperlinks, tables, any html code except for a flash object!!
the banner.innerHTML="<object ...." does not work...

this is why i thought of iframe and that way i can change its source... which brings me to my problem...

thanks, any other suggestions?
Cheers, Dan
0
 
LVL 11

Author Comment

by:Dany Balian
ID: 9915754
just as a hint!!

when i check on the back history button (i can see a list of my ads turning...)

Advertisement
Advertisement
Advertisement
Advertisement
Advertisement
Advertisement

so a hint would be maybe to alter the history of the browser so that it doesnt load this frame's location into history... could that be done?
can we specify if we want to include the curent page's location in history or not?

Cheers, Dan
0
 
LVL 16

Accepted Solution

by:
jaysolomon earned 250 total points
ID: 9920818
This works for innerHTML

meaning i can set a object (flash) in a div's innerHTML

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript">
<!--
function setInnerHTML(obj){
      document.getElementById(obj).innerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0" width="100" height="22">'+
                                                  '<param name=movie value="button1.swf">'+
                                                  '<param name=quality value=high>'+
                                                  '<param name="BASE" value=".">'+
                                                  '<param name="BGCOLOR" value="">'+
                                                  '<embed src="button1.swf" base="."  quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="100" height="22" bgcolor="">'+
                                                  '</embed>'+
                                                '</object>';
}
// -->
</script>
</head>
<body>
<a href="#" onclick="setInnerHTML('myDiv');return false;">SS</a>
<div id="myDiv"></div>
</body>
</html>
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Article by: DanRollins
This article describes a JavaScript program that creates a maze made of hexagonal cells.  In Part 2 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7850-Hex-Maze-Part-2.html), we'll extend the program by adding a depth-…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

747 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

11 Experts available now in Live!

Get 1:1 Help Now