Google Track Outbound Links window.onload conflicts with previous window.onload | Troubleshooting All in One SEO Pack Pro | Support | Semper Plugins

Avatar

Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
Google Track Outbound Links window.onload conflicts with previous window.onload
October 10, 2013
2:54 am
Avatar
Brad Kirwan
Member
AIOSEOP
Forum Posts: 5
Member Since:
September 9, 2013
sp_UserOfflineSmall Offline

Site http://www.oceanhomeloans.com.au

I have 6 pages on my website that I do an iframe pre-load using java script with window.onload and a function to pre-load, this is a Firefox specific fix so that the page does not appear to be continually loading. After updating to the new version of AIOSEO I chose the new Track Outbound Links function, it appears that this sets function(), overriding the previous and my iframe does not load.

I have coded a work around (not very elegant) using JQuery as these pages are extremely important to the site but if neccessay I could revert one of the pages for investigation.

I have highlighted the areas that I think are conflicting.

I can confirm that the only time the iframe fails to load is when the “Track Outbound Links” is selected.

This code is from a localhost version and I can confirm that it also shows the same behaviour as the live site did.

Javascript is coded in the wordpress page in the area for scripts below the page content etc.

View of source code shows: (see highlighted in red)

<script type="text/javascript">
window.onload = get_my_calculator_now;
function get_my_calculator_now() {
javascript:document.getElementById('HowMuchCanIBorrow').innerHTML = '<iframe width="720" scrolling="no" height="520" frameborder="0" marginheight="0" marginwidth="0" src="http://www.oceanhomeloans.com.au/calculators-new/borrowing-power.html" title=”Calculate how much you can borrow for your mortgage here” style="position: absolute;  centre: 0px;"></iframe>';
}
</script><style type="text/css">.site-header .title-area { background: url(http://localhost/htdocs/wp-content/uploads/2013/09/cropped-logo.png) no-repeat !important; }</style>
<!--[if lt IE 9]><script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script><![endif]-->

<!-- All in One SEO Pack Pro 2.1.4 by Michael Torbert of Semper Fi Web Design[198,228] -->
<link rel="author" href="https://plus.google.com/u/0/109786374416218111081/" />
<meta name="description" content="A calculator that lets you know what your borrowing capacity is for a mortgage. Use this to calculate how much you can borrow for your home or investment loan." />

<meta name="keywords" content="how much can i borrow, how much can you borrow, mortgage, calculator, home loan, calc, banks, lenders, finance, borrowing, capacity, investment, loans, mortgages, borrowing power, borrowing capacity, calculators, calculate, property, buy, buying, purchase, gold coast" />
<meta name="robots" content="index,follow,noodp,noydir" />

<link rel="canonical" href="http://localhost/htdocs/?page_id=1034" />
<meta property="og:title" content="Home Much Can I Borrow Home Loan &amp; Mortgage Calculator" />
<meta property="og:type" content="article" />
<meta property="og:url" content="http://localhost/htdocs/?page_id=1034" />
<meta property="og:image" content="http://www.oceanhomeloans.com.au/new/wp-content/plugins/all-in-one-seo-pack-pro/images/default-user-image.png" />
<meta property="og:site_name" content="Ocean Home Loans" />
<meta property="fb:admins" content="1667078603" />
<meta property="og:description" content="A calculator that lets you know what your borrowing capacity is for a mortgage.  Use this to calculate how much you can borrow for your home or investment loan." />
<meta name="twitter:card" content="summary" />
<meta name="twitter:description" content="A calculator that lets you know what your borrowing capacity is for a mortgage.  Use this to calculate how much you can borrow for your home or investment loan." />
		<script type="text/javascript">
		  var _gaq = _gaq || [];
		  _gaq.push(['_setAccount', 'UA-18188437-1']);
		  _gaq.push(['_trackPageview']);
		  (function() {
		    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
		    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
		    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
		  })();
		</script>
		<script type="text/javascript">
		function recordOutboundLink(link, category, action) {
					_gat._getTrackerByName()._trackEvent(category, action);
					if ( link.target == '_blank' ) return true;
			setTimeout('document.location = "' + link.href + '"', 100);
			return false;
		}
			/* use regular Javascript for this */
			function getAttr(ele, attr) {
				var result = (ele.getAttribute && ele.getAttribute(attr)) || null;
				if( !result ) {
					var attrs = ele.attributes;
					var length = attrs.length;
					for(var i = 0; i < length; i++)
					if(attr[i].nodeName === attr) result = attr[i].nodeValue;
				}
				return result;
			}

			window.onload = function () {
				var links = document.getElementsByTagName('a');
				for (var x=0; x < links.length; x++) {
					if (typeof links[x] == 'undefined') continue;
					if (typeof links[x].onclick != 'undefined') continue;
					links[x].onclick = function () {
						var mydomain = new RegExp(document.domain, 'i');
						href = getAttr(this, 'href');
						if(href && href.toLowerCase().indexOf('http') === 0 && !mydomain.test(href)) {
							recordOutboundLink(this, 'Outbound Links', href);
						}
					}
				}
			};
		</script>
<!-- /all in one seo pack pro -->


 

 

October 10, 2013
10:08 am
Avatar
Peter Baylies
Admin
Forum Posts: 578
Member Since:
October 16, 2011
sp_UserOfflineSmall Offline

** You currently do not have permission to see this post. To obtain access to these Premium Support Forums, please purchase a plugin and support subscription from Semper Plugins **

October 10, 2013
7:06 pm
Avatar
Brad Kirwan
Member
AIOSEOP
Forum Posts: 5
Member Since:
September 9, 2013
sp_UserOfflineSmall Offline

Peter,

Thanks, i’ll keep using my work around until the code is updated in the next release.

Forum Timezone: America/New_York

Most Users Ever Online: 964

Currently Online: Lisa Dotson
60 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

Member Stats:

Guest Posters: 35

Members: 19929

Moderators: 0

Admins: 8

Forum Stats:

Groups: 4

Forums: 28

Topics: 1894

Posts: 8079

Newest Members:

Muhammad Shafique

Administrators: Michael TorbertPeter BayliesSupport TeamSteve MortiboyMatthew RobinsonSteve KlasenArnaud BroesAshish Ravi

[i]
[i]
Skip to toolbar