[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Anchor Tags and IE8

Posted on 2012-03-12
6
Medium Priority
?
670 Views
Last Modified: 2012-04-02
I have a page that has anchor tags.   A user clicks on a link that pops up a new window to add notes to the option for a presenation.   Once they are done adding notes, the pop-up window has a javascript to refresh the parent page to show that notes have been added to that slide.    The list of options on the parent page is fairly long so the desire is to have the refresh return to the anchor/slide that was just modified so that the user doesn't have to scroll back down.    This works just fine in Firefox and Chrome but doesn't in IE.    It refreshes the page but doesn't go to the anchor.   I have seen some comments that IE just gives up right away if the anchor is written yet so I imagine that is my problem.    Does anyone have a solution to this?
0
Comment
Question by:digitalwise
[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
  • 3
  • 3
6 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 37713647
Showing the script you have issues with would be very useful
0
 

Author Comment

by:digitalwise
ID: 37714413
This is all I am using to refresh.

 <SCRIPT Language="JavaScript">
opener.location.reload();
self.close();
</SCRIPT>

Open in new window

0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 37714441
So you need to send the anchor to the popup so it can do

opener.location="whateverurl.com/page.html#anchor"

instead OR save the anchor in a cookie and do

window.onload=function() {
  var anc = getCookie('currentAnchor');
  if (anc && document.getElementById(anc)) {
    document.getElementById(anc).scrollIntoView()
  }
}

I am using ID instead of name="#somename" here. All modern browsers will allow ID instead
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 

Author Comment

by:digitalwise
ID: 37714625
We are using ID as well.   However it still isn't working.  I tried both of your solutions which work great.   But IE just doesn't appear to care.   It appears that IE just doesn't wait for the page to load all of the way and it stops looking for the id when it isn't readily available.   Firefox and Chrome don't have any issues.
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 1500 total points
ID: 37714753
This should work in IE for sure.

If not, you may have some other issues like not-unique IDs (which IE normally has less of a problem with than Chrome and Fx)

Did you try the onload?

window.onload=function() {
  var anc = getCookie('currentAnchor');
  if (anc && document.getElementById(anc)) {
    document.getElementById(anc).scrollIntoView()
  }
}

Have a look at this article

http://www.zachleat.com/web/domcontentloaded-inconsistencies/
0
 

Author Comment

by:digitalwise
ID: 37725191
This works on the initial click to open the new window but still not on the reload from the page closing...
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
Without even knowing it, most of us are using web applications on a daily basis.  In fact, Gmail and Yahoo email, Twitter, Facebook, and eBay are used by most of us daily—and they are web applications. We generally confuse these web applications to…
This Micro Tutorial will demonstrate how to add subdomains to your content reports. This can be very importing in having a site with multiple subdomains.
Want to learn how to record your desktop screen without having to use an outside camera. Click on this video and learn how to use the cool google extension called "Screencastify"! Step 1: Open a new google tab Step 2: Go to the left hand upper corn…

650 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