Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 11 years ago

#6872 closed bug (invalid)

selector, variable assignment, replace and value of replaced variable

Reported by: jas Owned by:
Priority: Milestone: 1.4.2
Component: selector Version: 1.4.2
Keywords: Cc:
Blocked by: Blocking:


I am not sure if this can be considered a bug or not, maybe just unexpected behavior within the library.

Here is the code I am working with:

$j('#addProduct').click(function() {

]]').each(function() {

]]').bind('blur', function() {

if ($j(this).val()) {

var x = $j(this).attr('id').replace('txtProductQuantity','txtProductPrice'); alert(x+' => '+$j('input[name='+x+']').attr('name'));





As you can see the click event executes a selector to bind events too. During the bind process function execution I am replacing the bind name with another at which time I attempt to get the name attribute.

For whatever reason it reverts back to the 'txtProductQuantity' prior to being replaced with 'txtProductPrice' and assigned to 'x'.

Change History (1)

comment:1 Changed 13 years ago by dmethvin

Resolution: invalid
Status: newclosed

I am not sure if this can be considered a bug or not,

If you determine that it is a bug, please reopen the ticket with a complete test case. You can get general jQuery help in the forum.

Note: See TracTickets for help on using tickets.