I've added some simple javascript / jquery code in my Rail App that is ready to display the following warning:
"Duplicate jQuery Selector". The environment gives me additional information about the warning message:
Checks that the jQuery selectors are used efficiently, this descendant selectors Suggests dividing which are already placed before the ID selector and warn about duplicated selectors who can be cached.
The code is very simple and I have been using it for years to check whether the element is provided, if it is not found, the element is added to the page: < / P>
if ($ ('# error'). Length == 0) {$ ('& lt; span class = "error" id = "error" & gt;' + error_message + ' & Lt; / span & gt; ') .inertAfter (' # element '); } And {$ ('# Error'). Html (error_message); } The environment is giving me the error above for the following line:
$ ('# error'). Length == 0 I used it for a long time but see it again, is it a way to rewrite it, the only thing I have found is the use of the bus To do:
$ ('# error'). Length But the environment shows me a single warning.
Is it really optimized and I am not using it properly or can the result of some internal misconception from the rules of the environment?
There is nothing wrong with the wrong or slow jQuery syntax of the warning selector I am using the same selector and the RubyMin environment is saying that it can be customized in terms of this selector: Search var selector = $ (jquery_selector)
Posted by
Unknown
at
03:22
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
About Me
Unknown
View my complete profile
Blog Archive
►
2015
(1886)
►
September
(203)
►
August
(208)
►
July
(224)
►
June
(210)
►
May
(230)
►
April
(195)
►
March
(209)
►
February
(201)
►
January
(206)
►
2014
(2117)
►
September
(239)
►
August
(251)
►
July
(226)
►
June
(208)
►
May
(229)
►
April
(199)
►
March
(255)
►
February
(275)
►
January
(235)
►
2013
(2011)
►
September
(199)
►
August
(228)
►
July
(210)
►
June
(222)
►
May
(217)
►
April
(229)
►
March
(243)
►
February
(221)
►
January
(242)
►
2012
(1993)
►
September
(227)
►
August
(235)
►
July
(225)
►
June
(206)
►
May
(221)
►
April
(216)
►
March
(206)
►
February
(227)
►
January
(230)
▼
2011
(1964)
►
September
(220)
▼
August
(222)
java - How to implement a JPanel that shows/hide c...
r - fit an xtable to a pdf file -
python - Best practices for Querying graphs by edg...
haskell - Returning True for only 1 Function out o...
java - Generate API docs with Javadoc -
jQuery $(window).resize not firing within jQuery p...
sharepoint - Xstl global variable set in for each ...
javascript - Handle stuff after dom changes -
javascript - Console error when drawing to canvas -
smartcard - Reading big file from a javacard applet -
sql - Sqlite Transaction - When Does Reserve Lock ...
jsp - dojotype="dijit.form.FilteringSelect" causin...
ios - How to add a decimal button -
list - Copy the last three lines of a text file in...
cocoa - Custom insertion point for NSTextView -
jquery - ko foreach not working -
java - text from JSpinner to JTextArea -
batch file - Dos command and its output -
How do I prevent "r 'library' or 'require' calls n...
.net - Maintain list data when appending C# -
css3 - CSS - Cropping Image Height To Match Text L...
windows - heroku postgresql odbc connection error -
c# - Remove item click event handler for single it...
c# - How can I pass a collection of objects from V...
c# - How to separate img tags in description of xm...
javascript - Jquery UI Elements Not Showing in a F...
jquery - Graphically link the principal nav bar wi...
javascript - jQuery: Dynamic Elements with Timers ...
mysql - Searching Across Multiple Tables -
jquery - Adding .toggle() to cell content -
function - I have two scala projects - basically t...
bash - Reading delimited value from file into a ar...
sms - iOS MessageUI.h not found -
xml - Sql server XQuery sql:variable and bit data ...
@Function Annotation in Mule -
Using awk if condition together with in an array c...
security - remember me functionality with specific...
How do I find the exception type of an exception t...
java - How to get file size in KB and MB in android -
c# - stream.read gives corrupted bytes -
sql - Conditional DataGrid formatting Colors -
c# - printdocument printing issue only prints firs...
Visual Studio treat custom extension as CSharp -
What does .between? method means in Ruby? -
java - android.os.NetworkOnMainThreadException err...
c - Change stack space -
Java reflection with unique id -
cordova - How to upgrade Android Phonegap 2.7.0 to...
Java regex possesive quantifiers -
Using VIM effectively with Ruby/Rails -
javascript - how to prefetch / cache iframe conten...
ruby - Retrieve comments and replies with Koala gem -
python - Why do Flask Extensions exist? -
javascript - ExtJS - Remote filtering causes probl...
Outputting Date and Time in C++ using std::chrono -
ios - UITableViewCell not showing subview UITextVi...
glsl - How do I create a proper bevel effect fragm...
css3 - How to make this layout in CSS? -
authentication - Python Https Request -
Global vars in python -
android - Editing an existing AlarmClock instead o...
regex - Regular Expression - Matching and extracti...
redirect - how to follow meta refreshes in Python -
css3 - What is the CSS order for a field being hov...
PHP Is MySQL DATETIME Field 14 days ago from today...
Encrypt file with PHP OpenSSL -
sql server - SQL performance: Recompile versus dro...
excel vba - Select Case Function with Multiple Cri...
How do i open a file from different path(not the s...
unix - AIX Shell Script - Formatting a long line o...
html - Show/hide content using jquery in multiple ...
Can't logout mysql and php -
java - Parsing error for date field -
c# - How to run application as another user from w...
visual studio 2010 - How to clear the Flash cache? -
flex - Styles metadata is not included in release ...
How to convert all elements of a bash array to low...
css - How to move text to the Right in HTML? -
php - Custom header or query string when proxying ...
c++ - Recv() call hangs after remote host terminat...
c++ - int multiplication overflow in LCG -
CRYSTAL REPORT Formatting and formula -
if statement - If EXE opens, then RUN -
ios - ABBYY Cloud OCR SDK returning empty authToke...
java - is there a way to instantiate an object of ...
visual c++ - fatal error LNK1120: 1 unresolved ext...
where to find the list of function of nodes in che...
How to implement jquery autocomplete using Zend fr...
How to deploy wcf service on amazon elasticbeansta...
ios - iphone ask for Current location permission a...
Lotus Notes 7 - copy / move docs. ( parent & respo...
generate vertices using geometry shader(GLSL) -
variables - Difference between defining SAS macrov...
java - making a game in a JFrame -
Caculate scale portion in cocos2d -
asp.net mvc - Show partial View in pop up window -
jquery - Cross domain error even when ajax called ...
nsis - get the version of an installed file -
java - Maven: advantages of dependency management -
android - Manipulating a ListView's items containe...
►
July
(219)
►
June
(224)
►
May
(219)
►
April
(206)
►
March
(216)
►
February
(221)
►
January
(217)
►
2010
(1952)
►
September
(230)
►
August
(202)
►
July
(221)
►
June
(207)
►
May
(213)
►
April
(199)
►
March
(234)
►
February
(244)
►
January
(202)
Powered by Blogger.