pages loaded in iframe alter the main page history

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
LVL 11
Dany BalianCTOAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

jaysolomonCommented:
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
Dany BalianCTOAuthor Commented:
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
Dany BalianCTOAuthor Commented:
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
jaysolomonCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.