Solved

is there anything I could do to speed up this routine ?

Posted on 2012-03-18
1
180 Views
Last Modified: 2012-06-21
it moves selected checkboxes to an array:
they all are inside a 'tab' div but jquery does not allow me to do $('#tab input.c')
otherwise it would be probably one method to improve performance

	 var start = new Date().getTime();
 	  
	 pchecked[currentPage] = [];
	 $('input.c').each(function() 
	  {	
	 
	   var checksts = this.checked;
		 if (checksts == true) 					 			  			 
	        pchecked[currentPage].push(this.name);   
	  });
	 
	 var end = new Date().getTime();
	 var time = end - start;
	 alert('Execution time: ' + time);

Open in new window

0
Comment
Question by:Rozamunda
1 Comment
 
LVL 40

Accepted Solution

by:
gurvinder372 earned 500 total points
ID: 37735116
try

 $('input.c:checked').each(function()
 {            
              pchecked[currentPage].push(this.name);  
 });

check
http://api.jquery.com/checked-selector/
0

Featured Post

Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my daily work (mainly using ASP.net), I need to write a lot of JavaScript code. One of the most repetitive tasks I do are the jQuery Ajax calls. You know: (CODE) I don't know if for you it's the same, but for me is soooo tedious to write the …
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question