Jquery in Drupal 7 in IE7
All,
On our website we are having issues with getting any jquery code to execute in IE7 (IE9 running in IE7 compatibility mode).
What is confusing is that the javascript code is running fine (for validation & css properties change), however, none of the jquery code is runnin开发者_StackOverflowg in IE7 mode.
Below is snippet of jquery code (placed inside a Drupal block) we are using on our site for showing a jquery popup after a user email has been accepted into the db.
<?php
drupal_add_js('jQuery(document).ready(function () {
jQuery(".input1").keypress(function(){
jQuery(this).css({
"color": "black",
});
});
jQuery(".input2").blur(function(){
var itext= jQuery(this).val();
if(itext=="email address" || itext=="enter invite code")
{
jQuery(this).css({
"color": "rgb(200,200,200)",
});
}
});','inline');
?>
The problem is that this code runs fine in all browsers except IE6 & IE7. Would you someone please shed some light on where we might be going wrong with making our site compatible with IE7.
Best,
Dear the internet explorer is quiet strict in interpreting your syntax. It wouldn't allow your syntax to be executed, no matter how a small silly mistake you left. Remove the comma at the end of the last property of your css. that is after "black" and "rgb(...)"
jQuery(this).css({
"color": "black"
});
hopefully, it will work
精彩评论