Ik gebruik de WordPress Stats plugin van Automattic en deze voegt wat JS code toe aan de footer. Deze code geeft in IE een "'undefined' is leeg of geen object" JavaScript foutmelding. Dit is de JS zoals het in de brondcode van de website staat:
En zo staat de code in het PHP bestand (incl. de hele functie):
Heeft iemand enig idee hoe ik van die foutmelding kan afkomen? Alvast bedankt!
code:
1
2
3
4
5
6
7
| <!--stats_footer_test--><script src="http://stats.wordpress.com/e-201116.js" type="text/javascript"></script> <script type="text/javascript"> st_go({blog:'22******',v:'ext',post:'2037'}); var load_cmc = function(){linktracker_init(22******,2037,2);}; if ( typeof addLoadEvent != 'undefined' ) {addLoadEvent(load_cmc);} else {load_cmc();} </script> |
En zo staat de code in het PHP bestand (incl. de hele functie):
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
| function stats_footer() { global $wp_the_query, $current_user; $options = stats_get_options(); echo "<!--stats_footer_test-->"; if ( !$options['footer'] ) stats_set_option('footer', true); if ( empty($options['blog_id']) ) return; if ( !$options['reg_users'] && !empty($current_user->ID) ) return; $a['blog'] = $options['blog_id']; $a['v'] = 'ext'; if ( $wp_the_query->is_single || $wp_the_query->is_page ) $a['post'] = $wp_the_query->get_queried_object_id(); else $a['post'] = '0'; $http = is_ssl() ? 'https' : 'http'; ?> <script src="<?php echo $http; ?>://stats.wordpress.com/e-<?php echo gmdate('YW'); ?>.js" type="text/javascript"></script> <script type="text/javascript"> st_go({<?php echo stats_array($a); ?>}); var load_cmc = function(){linktracker_init(<?php echo "{$a['blog']},{$a['post']},2"; ?>);}; if ( typeof addLoadEvent != 'undefined' ) {addLoadEvent(load_cmc);} else {load_cmc();} </script> <?php } |
Heeft iemand enig idee hoe ik van die foutmelding kan afkomen? Alvast bedankt!