jQuery(this).attr('href') error in IE

Posted by Ashsurve under ASP.NET AJAX on 5/30/2013 | Points: 10 | Views : 2213 | Status : [Member] | Replies : 0
I am getting this error::

Error: Unable to get value of the property 'trim': object is null or undefined

I want alternative to this line if(jQuery(this).attr('href').trim() == "treatment-pictures.aspx")
It is giving an error in IE only and not in other browsers.
Code::
jQuery("a").click(function () {
if(jQuery(this).attr('href').trim() == "treatment-pictures.aspx")
{
var s = s_gi(s_account);
s.linkTrackVars = "None";
s.linkTrackEvents = "None";
s.trackDownloadLinks = false;
s.trackExternalLinks = false;
s.linkTrackVars = "prop17,prop18,eVar17,eVar18,events";
s.prop17 = s.eVar17 = (s.channel + "|See Results");
s.prop18 = s.eVar18 = s.pageName;s.linkTrackEvents = "event14";
s.events = "event14";
s.tl(this, "o", s.prop17 + " Callout Clicked");
}
});

Thanks
Ashwini




Responses

(No response found.)

Login to post response