Solved

pages loaded in iframe alter the main page history

Posted on 2003-12-10
4
441 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
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…

707 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