/    Sign up×
Community /Pin to ProfileBookmark

Iframe Code is not working into Safari and Crome. It is working into IE 8.0

Hi,

My web page code is below. I want to run a html framework where i used iframe code. It is working into IE8.0 and below version but it is not working into Safari or Crome. Can you help me in this. How can i run all my pages into the safari and crome.

<!DOCTYPE HTML>
<html>
<head>
<charset=”utf-8″>
<title>Index page</title>
<script>

var urls = new Array(‘Page1.html’,’Page2.html’,’Page3.html’,’Page4.html’);
I=0;

function next()
{
I+=1;
if (I == urls.length-1)
{
document.getElementById(“next”).style.display = “none”;
}

window.frames[‘links’].location.href=urls[I];
document.getElementById(‘back’).style.display=’inherit’;

}

function prev()
{
I-=1;
if(I==0)
{
document.getElementById(“back”).style.display = “none”;
}
window.frames[‘links’].location.href=urls[I];
document.getElementById(‘next’).style.display=’inherit’;
}

</script>
</head>
<body>
<div id=”main” style=”border:solid #666; width:100%; height:auto;”>
<div id=”header” style=”border:solid #F00; width:99.5%; height:50px;”>
</div>
<div id=”middle” style=”border:solid #099; width:99.5%; height:460px;”>
<div id=”body_left” style=”border:solid #006; width:29.50%; height:455px;”>
</div>
<div id=”body_right” style=”border:solid #963; width:69.5%; height:455px; margin-left:auto; margin-top:-461px; position: relative;”>
<iframe src=”page1.html” scrolling=”auto” id=”links” name=”links” width=”99.5%” height=”450″></iframe>
</div>
</div>
<div id=”footer” style=”border:solid #FF0; position: ; width:99.5%; height:auto;”>
<div id=”footer_left” style=”border:solid #0FF; width:79.475%; height:50px;”>
</div>
<div id=”footer_right” style=”border:solid #6F6; width:19.4375%; height:50px; margin-left:auto; margin-top:-56px;”>
<div id=”img_a” style=”margin-top:10px; margin-left:30px;”>
<img src=”images/previous_01.jpg” alt=”Back” id=”back” align=”middle” class=”hover” style=”cursor:pointer” onclick=”prev();”/>
</div>
<div id=”img_b” style=”margin-top:-30px; margin-left:80px; float”>
<img src=”images/next_01.jpg” alt=”Next” id=”next” class=”hover” align=”middle” style=”cursor:pointer” onclick=”next();”/>
</div>
</div>
</div>
</div>
</body>
</html>

to post a comment
JavaScript

3 Comments(s)

Copy linkTweet thisAlerts:
@daveyerwinSep 18.2012 — I believe your server

needs to send this header

'X-XSS-Protection: 0'

see if this thread describes

your situation

http://www.codingforums.com/showthread.php?t=253796
Copy linkTweet thisAlerts:
@ankitbnl406authorSep 21.2012 — No. It is not solving. Please do help me? What are the alternatives to load the content dynamically.
Copy linkTweet thisAlerts:
@MrSnowDropSep 21.2012 — Try to replace the code like this:

[COLOR="#000080"]document.getElementById('links').location.href='url...'[/COLOR]

instead of:

[COLOR="#B22222"]window.frames['links']...[/COLOR]

In my experience, the first soultion is cross-browser too (Firefox usually gives problems in iframes JS calling syntax).
×

Success!

Help @ankitbnl406 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...