Skip to main content

Bug Tracker

Side navigation

#12796 closed bug (notabug)

Opened October 27, 2012 10:53AM UTC

Closed October 27, 2012 01:53PM UTC

Last modified October 28, 2012 02:55PM UTC

This script no longer works from jQuery 1.8 onwards

Reported by: limguowei@gmail.com Owned by:
Priority: undecided Milestone: None
Component: unfiled Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:
Description
$(document).ready(function(){$("#container").on("submit",".edit_question",function(){return!$("input[@name='question[answer]']:checked").val()||!$("input[@name='answer[]']:checked").val()?confirm("Are sure you want to submit a blank answer?"):!0})});

Is this deliberate or there is a substitute?

Attachments (0)
Change History (6)

Changed October 27, 2012 01:53PM UTC by dmethvin comment:1

resolution: → notabug
status: newclosed
"input[@name='question[answer]']:checked"

I think the @ prefix for attributes was dropped in jQuery 1.2, back in 2008. It's not part of the W3C CSS selector syntax.

Changed October 27, 2012 02:55PM UTC by limguowei@gmail.com comment:2

Hi I wish to clarify that the code works on JQuery 1.7.2

When I CDN the JQuery 1.7.2 library from google it works as intended

When I CDN the JQuery 1.8.0 library from google it fails

When I CDN the JQuery 1.8.1 library from google it fails

When I CDN the JQuery 1.8.2 library from google it fails

I tried your recommendation and remove the @ prefix again it fails.

Changed October 27, 2012 02:57PM UTC by dmethvin comment:3

We would need a complete test case to reproduce the issue then. Please provide a link to either a jsbin.com or jsfiddle.net test case.

Changed October 28, 2012 02:27AM UTC by limguowei@gmail.com comment:4

Hi I add a jsbin.com Test case here

http://jsbin.com/onicuz/1/edit

If you change the cdn google to 1.8.2 it fails and it works on 1.7.2

Changed October 28, 2012 02:41PM UTC by dmethvin comment:5

Your selectors are invalid and they work correctly when the @ is removed. There is no bug. If you need more help ask for it on a forum.

Changed October 28, 2012 02:55PM UTC by limguowei@gmail.com comment:6

If you remove the @ the alert gets trigger even if you selected a value on jQuery 1.8.2 which is NOT suppose to.