Blog

Internet Explorer And JQuery .click() event

Posted by:

Internet Explorer And JQuery .click() event

This should be a simple short post, because :

  • IE doesn’t deserve me to waste time writing about it. I just do to help other fellows.
  • Its an issue I faced lately and solved, so, its not a feature or technology.

The issue is :

I needed to create a pop up window upon selecting an option from a select combo box. At first I used JQuery PopUpWindow plugin. It worked fine in Firefox, but it didn’t work on IE.

Code Was Similar to this


/** Making payment method .. open pop up window */
function popitup(url) {
newwindow=window.open(url,'name','height=600,width=900');
if (window.focus) {newwindow.focus()}
return false;
}
window.name="memberPage";
// Open Credit card information page
var openPopUp = function(){
if(0==$(this).val()){
var link = $("#creditCardLink").attr('href')+$("#memberIdValue").text();
popitup(link);
}
}

// $("#billingMethod").change(openPopUp);
$("#billingMethod option").click(openPopUp);

I thought its because a pop up issue in IE. But Later I found that its the even registeration issue.

 

So, I changed the bind statement from JQuery Bind to HTML onChange like this :





;

and Commented the Event Binding Java Script Code .. Like this :



// $("#billingMethod").change(openPopUp);
//$("#billingMethod option").click(openPopUp);

And Thats it.

 

0