I have a custom WordPress plugin I made and it doesn’t seem to work in IE7 or IE8. But works fine in IE9.
So the user clicks this link:
<a style="cursor:pointer;color:#ddd;" onclick="Javascript:cp_module_lottery1ptentry();">LINK</a>
Which in turn calls this:
function cp_module_lottery1ptentry(){
cpdlotterymsg='<?php _e('Are you sure you want to use ', 'cplotto'); ?> <?php echo get_option('cp_lottery1_enter_amount'); ?> <?php _e(' points to purchase a '.get_option('cp_point_entry_label').'?', 'cplotto'); ?>';
thebox = new Boxy('<form id="cp_donate" name="cp_donate" method="post" onsubmit="Boxy.confirm(cpdlotterymsg,function(){cp_module_lottery1ptentry_do();});return false;"><p><strong><?php _e('Use', 'cplotto'); ?> <?php echo get_option('cp_lottery1_enter_amount'); ?> <?php _e('points to purchase a '.get_option('cp_point_entry_label').'.', 'cplotto'); ?></p><br /><br /><input type="submit" value="<?php _e('Purchase '.get_option('cp_point_entry_label').'', 'cplotto'); ?>" style="width:300px;" /></form>', {title: '<?php _e(''.get_option('cp_point_entry_log_label').'', 'cplotto'); ?>', modal: true});
}
Which works, but the next step it break where it calls: cp_module_lottery1ptentry_do()
function cp_module_lottery1ptentry_do(){
<?php $cb_current_page_url = get_permalink(); ?>
jQuery.ajax({
url: "<?php bloginfo('url'); ?>/wp-admin/admin-ajax.php",
type: "POST",
cache: false,
dataType: "json",
data: "action=cp_module_lottery1ptentry_do",
success: function(data){
if(data.success==true){
Boxy.alert(data.message);
window.setTimeout('window.location = "<?php echo $cb_current_page_url; ?>"', 5500);
thebox.hide();
thebox.unload();
}
else{
Boxy.alert(data.message);
}
}
});
}
I get no errors in IE7/IE8 just nothing happens when it calls the cp_module_lottery1ptentry_do() function.
I did a lot of searching and try several things but nothing is working.
2 things I changed to get it working. I changed the data to this:
Then the box variable I removed all html code:
So now it works, in IE6 – IE9! Here if the final code:
}
I also have a .js file which has this in it. Thank you for the ajaxSetup tip Matt Wolfe!