Sei sulla pagina 1di 1

JQuery Events for IE7 Browser

1) JQuery $.trim() event


Solution that did NOT work in IE7:
$('#keywords').val().trim();
Solution that works in IE7:
var searchTerm = $('#keywords').val();
searchTerm = $.trim(searchTerm);
2) $('Selector').addClass(ClassName)
The value of the Class Name must be a value or .
It should not the undefined value & if it is undefined the further code in IE7
doesnt executes, causing unloading of file itself.
3) Grid content for IE7
Grid content is rendered in span tag for IE7.
If any event or class needs to be applied on grid content then, it has to apply on
span tag for IE7 browser.
4) Syntax Error
IE7 browser does not load the files having syntax errors.
"multiplicity" : {
"self" : "one",
"other" : "many",
"otherTextField" : "Name",
"isGenericList" : true,
"otherValueField" : "BuildingId",
"otherSource" : "list", -- The comma here would throw an error when
running on IE7
}
5) Avoid use of jQuery(*) ie all selector
The all or universal, selector is extremely slow & many a times causing timeouts on
IE7
e.g. In cmc.viewform.js, at line no. 434 we had a line of code
$("*", $target).remove();
which was replaced by
$($target).empty();
6) Avoid dynamic addition of any in-line event in any HTML tag.
e.g. onClick() event for anchor tag.

Potrebbero piacerti anche