Click here to Skip to main content
15,914,322 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionUsing a switch statement to count variables in an array Pin
tristarterror24-Jun-13 11:09
tristarterror24-Jun-13 11:09 
AnswerRe: Using a switch statement to count variables in an array Pin
fixthebugg24-Jun-13 11:35
fixthebugg24-Jun-13 11:35 
AnswerRe: Using a switch statement to count variables in an array Pin
lmf232s24-Jun-13 12:07
lmf232s24-Jun-13 12:07 
AnswerRe: Using a switch statement to count variables in an array Pin
Manfred Rudolf Bihy24-Jun-13 20:06
professionalManfred Rudolf Bihy24-Jun-13 20:06 
QuestionVariables not showing correctly in HTML Pin
tristarterror24-Jun-13 9:17
tristarterror24-Jun-13 9:17 
AnswerRe: Variables not showing correctly in HTML Pin
dusty_dex24-Jun-13 9:45
dusty_dex24-Jun-13 9:45 
GeneralRe: Variables not showing correctly in HTML Pin
tristarterror24-Jun-13 10:16
tristarterror24-Jun-13 10:16 
GeneralRe: Variables not showing correctly in HTML Pin
dusty_dex24-Jun-13 10:55
dusty_dex24-Jun-13 10:55 
Questionhow make a skype call by getting a phone number from textbox Pin
Pasqualissimo23-Jun-13 12:20
Pasqualissimo23-Jun-13 12:20 
QuestionMSN style links Pin
Bart23-Jun-13 10:20
Bart23-Jun-13 10:20 
AnswerRe: MSN style links Pin
thanh_bkhn23-Jun-13 16:09
professionalthanh_bkhn23-Jun-13 16:09 
GeneralRe: MSN style links Pin
Bart25-Jun-13 10:22
Bart25-Jun-13 10:22 
QuestionHow to show info marker google maps when clicked in outside map? Pin
Akbarblack22-Jun-13 4:12
Akbarblack22-Jun-13 4:12 
AnswerRe: How to show info marker google maps when clicked in outside map? Pin
Dan Randolph23-Jun-13 8:55
Dan Randolph23-Jun-13 8:55 
GeneralRe: How to show info marker google maps when clicked in outside map? Pin
Akbarblack10-Dec-13 20:32
Akbarblack10-Dec-13 20:32 
QuestionShopping Cart Qty Button - I need to make it faster Pin
jkirkerx21-Jun-13 11:16
professionaljkirkerx21-Jun-13 11:16 
AnswerRe: Shopping Cart Qty Button - I need to make it faster Pin
enhzflep24-Jun-13 11:19
enhzflep24-Jun-13 11:19 
Jeepers, in 6-7 secs on a 650Mhz android phone, I can generate an image thats 256x256, with 2 calls to _each_ of square root, sin and cos - perPixel.

Something I notice is that you've got many instances of $('[id*="_txt_Modal_Add2Cart_SelectQty"]') in your code. I'd try just evaluating that statement once, before then using it later - much like you did for the css rules.

I dont jQuery, I apologise if the syntax is incorrect.

In any case,the point is - evaluate expensive things as few times as possible.
In my code, this could be done by pre-computing sin cos and sqrt tables. In yours I'd assume you could evaluate the statement I've mentioned. I expect it takes jQuery some time to parse the statement before finding the element that you wish to target.

I.e
JavaScript
var txtModalSelectQtyEl = $('[id*="_txt_Modal_Add2Cart_SelectQty"]');
...
...
var qty_value = txtModalSelectQtyEl.val();
...
...
txtModalSelectQtyEl.css('background-color', txtFocus);
..
..

Make it work. Then do it better - Andrei Straut

GeneralRe: Shopping Cart Qty Button - I need to make it faster Pin
jkirkerx24-Jun-13 11:38
professionaljkirkerx24-Jun-13 11:38 
GeneralRe: Shopping Cart Qty Button - I need to make it faster Pin
enhzflep24-Jun-13 12:15
enhzflep24-Jun-13 12:15 
GeneralRe: Shopping Cart Qty Button - I need to make it faster Pin
jkirkerx24-Jun-13 12:33
professionaljkirkerx24-Jun-13 12:33 
GeneralRe: Shopping Cart Qty Button - I need to make it faster Pin
enhzflep24-Jun-13 12:53
enhzflep24-Jun-13 12:53 
QuestionJavascript, KnockoutJS (and possibly TypeScript) Pin
_Maxxx_19-Jun-13 18:32
professional_Maxxx_19-Jun-13 18:32 
AnswerRe: Javascript, KnockoutJS (and possibly TypeScript) Pin
AlphaDeltaTheta19-Jun-13 19:00
AlphaDeltaTheta19-Jun-13 19:00 
GeneralRe: Javascript, KnockoutJS (and possibly TypeScript) Pin
_Maxxx_20-Jun-13 1:29
professional_Maxxx_20-Jun-13 1:29 
GeneralRe: Javascript, KnockoutJS (and possibly TypeScript) Pin
AlphaDeltaTheta20-Jun-13 1:37
AlphaDeltaTheta20-Jun-13 1:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.