This Javascript doesn't work in IE but works in Chrome, Firefox and Opera
You need to apply ondomready
on the top left in jsfiddle
. It is working well. I tested it in IE10 too.
http://jsfiddle.net/o8v6xsze/1/
To solve the issue in IE10, you can use:
$('img').on('load', function() {
$("div").removeClass("spinner");
}).each(function() {
if(this.complete) $(this).load();
});
http://jsfiddle.net/o8v6xsze/3/
It is working in my IE10.
jQuery :contains works in FF, Safari and Chrome and not Internet Explorer
As alex mentioned in the comments putting &
in xml is not valid. Replacing that with &
in both cases in the string works fine in IE8.
Oh, and in your html there was an extra </div>
caused by a <div/></div>
in the middle somewhere.
I also threw in a parseXML since I'm assuming your GET returns the datatype as XML.
Forked jsfiddle that works in IE8.
Here is a XML validator - I just popped that in and it points to the &
(i thought at first there was nesting issues).
If you can't control the source, you might do a quick regex to fix it (not suggested).
jQuery Effects work in jsfiddle but not in offline/online
You need to add the jquery library, and it has to be the first thing you add.
Paste this <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
in your head tag, and make sure it's the FIRST script there.
Internet Explorer 8 and below issues
I updated your jsfiddle. The issue appears to be that your :first
selector isn't working in IE8. I'm not sure why you would need the :first
selector as there is only one ul
below each menu item, but maybe I missed something. If you remove the :first
selector it works fine.
AJAX jQuery call not firing in IE7, IE8 but works fine in Firefox, Chrome, etc
2 things I changed to get it working. I changed the data to this:
data: {action: "cp_module_lottery1ptentry_do"},
Then the box variable I removed all html code:
thebox = new Boxy('<form name="cp_donate" id="cp_donate" method="post" onsubmit="Boxy.confirm(cpdlotterymsg,function(){cp_module_lottery1ptentry_do();});return false;"><label for="cp_points"><?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'); ?></label><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});
So now it works, in IE6 - IE9! Here if the final code:
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 name="cp_donate" id="cp_donate" method="post" onsubmit="Boxy.confirm(cpdlotterymsg,function(){cp_module_lottery1ptentry_do();});return false;"><label for="cp_points"><?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'); ?></label><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});
}
function cp_module_lottery1ptentry_do(){
jQuery.ajax({
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 also have a .js file which has this in it. Thank you for the ajaxSetup tip Matt Wolfe!
jQuery.ajaxSetup({ url: "../../../wp-admin/admin-ajax.php", type: "POST", cache: false });
JQuery Code works in Firefox, Opera but not working in Chrome and IE
I tested on Chrome, and the commas did fine, but I never saw the underConstArea
update, while I did see it do so on Firefox after leaving the textbox.
I'm not sure what is happening there, but I have several ways of fixing it.
First, it seems that whether $("#readyArea").on('change')
fires is browser dependent. I don't know why, but it seems that Chrome doesn't throw a change event when you're changing the code. Maybe it's trying to avoid an infinite loop of changes; I'm not really sure.
If you're happy with the underConstArea
only updating when the number is done (as it behaves in firefox), you can do so on focusout
instead of on change
. I changed your top lines to
$("#readyArea").on('focusout', function() {
$("#underConstArea").val($(this).val());
});
and it worked fine for me in Chrome and Firefox. Here's an updated fiddle.
Alternatively, if you want it to update every time the user types, just update underConstArea
within your commaFormatted
function. Just add
$("#underConstArea").val(amount);
at the bottom of your function.
And the link to the second option I offered. Note that I removed any event catching on #readyArea
.
Jquery throws IE specific error
The error you're getting is due to jQuery needing to call the function resolveWith
which contains a try - finally
without a catch
block. Until IE9, this is not supported by IE and causes the error:
Unexpected call to method or property
access.
Essentially, it happens when the IE javascript engine tries to enter the finally block. An easy solution would be to link to your own copy of the jQuery source and add an empty catch
block to this function.
Alternately, if you do not have to use HTML5 markup, change your <construct>
tags with <p>
or a div with an id and change your jQuery selector and your issue should disappear since this jQuery function does not appear to be called. See a working update of your example in IE8 here: http://jsfiddle.net/JWSaZ/21/
Jquery show() function not working in IE8
Your checkboxes have display: none
. That seems to be why it doesn't work in IE8.
One possible fix is to bind your click event directly to the label instead, for example:
$('.show_label').click(function() {
var $input = $(this).find('input');
$('div.hidden').hide();
$('#' + $input.val()).show();
});
http://jsfiddle.net/thirtydot/bP4Uf/5/
Related Topics
Dropdown Image Not Visible in Chrome and Ie
How to Use Less Variable in React Js
How to Override the Style of the Material-Ui Switch Component When Checked
How to Open Blob Url on Chrome iOS
Changing Leaflet Markercluster Icon Color, Inheriting the Rest of the Default CSS Properties
How to Replay a CSS3 Animation in Reactjs
Z-Index Inherits Parents Z-Index , or Not
Using Jquery How to Show and Hide Different Div's Onclick Event
Jquery Tablesorter CSS Arrow Icons
Jquery/Js:Detect User's Scroll Attempt Without Any Window Overflow to Scroll To
Change CSS Link Property Onclick with JavaScript/Jquery
How to Position Popover Over a Highlighted Portion of Text
Calendar Not Showing Up in Bootstrap Datetimepicker
Expand Div Over Others on Mouse Over Jquery
How to Change Datatable Row Background Colour Based on the Condition in a Column, Rshiny