/    Sign up×
Community /Pin to ProfileBookmark

Javascript "top" object no longer valid when a sub-frame refreshes (Internet Explorer

Hi there!

I have this interesting problem that only happens with Internet Explorer Mobile on the Pocket PC( Mobile 5.0) and not on desktop IE.

I have a web page ( let’s call it top.htm ) that contains two frames( one.htm and two.htm)

two.htm would redirect to another page at a specific time.

But what I just uncovered is that when two.htm redirects to another page(within its own frame), the Javascript within it can no longer access the “top” or “parent” object. They will show up as undefined which is weird. The same issue goes for frame one.htm

This is how I defined the two frames in top.htm :

<frameset rows=”500,40″>
<frame src=”one.htm” allowtransparency=true marginwidth=0 marginheight=0 noresize scrolling=no frameborder=no name=”one” id=”one”>
<frame src=”two.htm” allowtransparency=true marginwidth=0 marginheight=0 noresize scrolling=no frameborder=no name=”two” id=”two”></frameset>

This is how I do the refreshing within the frame:

top.frames[‘one’].location.href = “somewhere.htm” ;

I have even tried these as well to no avail :

(1) top.frames[‘one’].navigate(“somewhere.htm”) ;

(2) self.location = “somewhere.htm” ;

Can someone please shed some light on this? If you need more details on the problem I can gladly provide them.

THANKS!

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @d2army 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.15,
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,
)...