Follow Me



Reloading an IFrame using IE 8

by Ramone Hamilton 7. November 2014 02:20

I ran into an issue the other day where a user pointed out that a search button that they were clicking was simply not refreshing the page and returning new results.  I went through the usual developer debugging steps and could not reproduce it anywhere.  That's when I decided to do a side by side with the user and check our configuration setup and soon enough found the root cause of the issue.  While I was using IE 11 for testing my application development and our QA team was using IE versions 9, 10 and 11, the user was using IE8.  Though less than 10% of our users still use the browser, we still officially support it so the issue had to be fixed.

 

Long story short, the problem was with refreshing an iframe and the means by which it was done.  in IE8 the following block of code does not work if the src of the iframe element is already the src you are directing it to:

 

window.top.document.getElementById('iframeName').src = "/someUrl";

This works fine in anything above that version.  The trick was check to see if the src of the element was the same, and if so, call a reload rather than resetting the src to itself again.

var iframeElement = window.top.document.getElementById('iframeName');
var url = '/someUrl';

if(iframeElement.src == url){
  iframeElement.contentWindow.location.reload();
}
else{
  iframeElement.src = url;
}

Hopefully this helps anyone who runs into this same issue.

Tags:

.NET | ASP.NET | Html | JavaScript | IE 8

RHI Participating in the City of Atlanta's Govathon

by Ramone Hamilton 16. February 2013 08:17

As we are a new company, we have been searching for oppurtunities to do some pro bono work to get our feet wet and build some work experience.  Reading over that statement I realized that probably doesn't make a lot of sense without at least a glimpse at the big picture.  Here goes nothing.

I am a developer at heart, I've been doing it since I was 11 years old and it has helped me provide for my family very well and consistently over the years, but for some reason, I just can't get enough of it.  I mean I do it all, meetups, webinars, code camps, you name it I do it.  One day my wife pulled me to the side and told in her best accountant voice, "Quit doing all this development for free, and monetize it.".  So I decide to and just began this new startup with just me, my younger brother and my wife handling all of the business relations and boring money stuff..

Getting back on topic!  

The City of Atlanta, lead by Mayor Kasim Reed and the Invest Atlanta team, have put together this great hackathon type event to help solve some of the Cities problems.  Our three man team here at RHI signed up together and are definitely looking forward to bringing our flavor of development to the masses.  If you are interested in participating, and the tickets are going fast, head over to their site at http://govathon.com.

Tags:

Tag cloud

    RecentPosts