jQuery: The Write Less, Do More JavaScript Library

Ticket #185 (closed bug: fixed)

Opened 2 years ago

Last modified 1 year ago

`]` breaks selectors

Reported by: anonymous Assigned to: anonymous
Type: bug Priority: major
Milestone: 1.0 Component: core
Version: 1.0 Keywords: ] selector
Cc: Needs:

Description

I want to select input files by their name, but ] seems to break jquery - no errors are thrown in my JS-console (ff). I use the latest svn co.

Here are some examples which break jquery:

    $("input[@name='foobar[]']").hide();
    $("input[@name='foobar[foobar]']").hide();

This does seem to work though:

    $("input[@name^='foobar['").hide();
    $("input[@name^='foobar[foobar'").hide();

The HTML would be:

    <input name="foobar[]" />
    <input name="foobar[foobar]" />

Hope you can fix this!

Attachments

Change History

Changed 2 years ago by mail@…

  • status changed from new to closed
  • resolution set to fixed

So, I think I found the bug myself:

Line 1779:

    .replace( 'Q', " *'?"?([^'"]*?)'?"? *" ), "i" );

This should be something like this:

    .replace( 'Q', " *('|"|)([^'"]*?)4 *" ), "i" );

But the backreference (4) only works for parse[1] obviously! Also now one more key exists in m - so we'll have to reorganize it.

Here is my fix: http://nopaste.php-q.net/238335

What I did: # removed arrays from jQuery.parse (I think we don't need those any longer) # count ( and S for the number of the backreference # changed Q regex # changed reorganizing of m

*Please test this* - it works for me, as far as I can tell!

Changed 2 years ago by john

  • status changed from closed to reopened
  • resolution deleted

Changed 2 years ago by mail@…

Woha, I found the test suite and have to say: Awesome! Debugging made easy. One more plus for jquery!

I changed two bugs within my fix, now all tests are passed.

http://nopaste.php-q.net/238501

Here is a suggestion for a test:

give input#hidden2 name="foo[bar]" t( "Grouped Form Elements", "input[@name='foo[bar]']", hidden2? );

Changed 2 years ago by mail@…

Sorry, messed up the suggestion:

give input#hidden2 name="foo[bar]"
t( "Grouped Form Elements", "input[@name='foo[bar]']", ["hidden2"] );

Changed 2 years ago by joern

  • version changed from 1.0b1 to 1.0

Added test to SVN, it fails in FF and dies in IE

Changed 2 years ago by mail@…

It fails with the old jquery filter, or? Not with my fix?

Changed 2 years ago by mail@…

http://nopaste.php-q.net/238509

That is an updated version (I forgot to remove a debug msg)

"it fails in FF and dies in IE" - try it with my fix - it should work.

Changed 2 years ago by joern

  • status changed from reopened to closed
  • resolution set to fixed

Added proposed fix to SVN, tested on FF 1.5.0.6, IE6 and Opera 9.01 works fine.

Changed 1 year ago by andyzzz

ativan diflucan ativan ativan celexa sonata ativan imitrex flomax ativan levitra levitra guaranteed cheapest online levitra com cialis levitra prescriptionscom viagra cialis levitra levitra clinical data cialis levitra sales viagra buy levitra online viagra cialis levitra levitra viagra buy levitra levitra softabs buy levitra online levitra online discount levitra order levitra levitra danger viagra cyalis levitra compared cialis compare levitra viagra which is better viagra cialis or levitra flonase levitra myonlinemeds biz nexium stimula nexium celebrex levitra nexium propecia renova valtrex viagra nexium side effects new yorker prilosec nexium between difference nexium prilosec nexium pharmacy paxil wiki levitra generic paxil paxil ultram lexapro paxil prozac zoloft paxil side effects prozac zoloft paxil zoloft versus paxil prozac vs paxil paxil vs zoloft paxil versus zoloft buspar celexa prozac paxil anafranil paxil withdrawal symptoms how to switch from paxil to celexa paxil zoloft between difference paxil zoloft paxil vs prozac depression celexa vs paxil prozac paxil paxil prozac vs zoloft or paxil zoloft paxil prozac prozac interactions with viagra cialis levitra ultram and prozac drug interaction prozac ultram prozac nation prozac side effects lexapro paxil prozac zoloft prozac zoloft paxil prozac vs paxil soma buy cialis levitra low online pharmacy price soma viagra drug interaction soma ultram drug soma akane soma buy soma soma mandal buy soma online prozac soma soma carisoprodol online prozac soma boards chongqed carisoprodol generic soma viagra cialis phentermine soma carisoprodol soma soma pharmacy buy cheap drugs lipitor tricor cardizem soma soma prozac soma online zoloft levitra lipitor online pharmacy pharmacy zoloft phentermine levitra low price pharmacy zoloft phentermine viagra ultram zoloft zoloft ultram zoloft ultram interaction zoloft side effects zoloft litigation weight, zoloft vs. lexapro zoloft versus lexapro lexapro zoloft zoloft and lexapro zoloft vs lexapro zoloft lexapro side effects lexapro versus zoloft zoloft lexapro comparison lexapro vs. zoloft changing from zoloft to lexapro weight gain more zoloft or lexapro which is better for anxiety lexapro or zoloft lexapro paxil prozac zoloft zyrtec levitra myonlinemeds biz vaniqa zyrtec myonlinemeds biz ultram ultram zyrtec 2737 aid amerimedrx com ultram zyrtec allegra claritin zyrtec claritin allegra zyrtec zyrtec cetirizine hcl lots of allergies just one zyrteco zyrtec clartin allegra zyrtec and allegra used together zyrtec and allegra combined combining allegra with zyrtec to treat hives zyrtec vs allegra myonlinemeds biz nexium zyrtec allegra zyrtec zyrtec claritin claritin zyrtec allegra vs zyrtec zyrtec and allegra zyrtec zantac error zyrtec side effects carisoprodol valium zyrtec

Note: See TracTickets for help on using tickets.