Modify ↓
Ticket #7690 (closed bug: invalid)
Opera - $("#id") fails when there is element with name="id"
| Reported by: | jozo.hovan@… | Owned by: | |
|---|---|---|---|
| Priority: | undecided | Milestone: | 1.6 |
| Component: | unfiled | Version: | 1.4.4 |
| Keywords: | Cc: | ||
| Blocking: | Blocked by: |
Description
In Opera (at least version 9.23) code fails with error. There is selector by id and it has conflict with hidden input element with same name.
<html>
<body>
<script src="jquery.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function (){
try{
$("#hInput");
alert("ok");
}catch(e){
alert("error");
}
});
</script>
<input type="hidden" name="hInput" value="val">
</body>
</html>
Change History
comment:2 Changed 2 years ago by jozo.hovan@…
Thanks for your investigation, affected jQuery version is 1.4.4. I understand that it's unable to resolve unwanted behaviour in all old versions of all supported browsers.
So I guess, it is better to claim that supported is Opera 9.x and 10.x (latest version) not Opera 9+ (from page http://docs.jquery.com/Browser_Compatibility )
Please follow the bug reporting guidlines and use jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.
Note: See
TracTickets for help on using
tickets.

Thanks for taking the time to contribute to the jQuery project by writing a bug report.
After checking your report I made a live test case with the latest jQuery (1.4.4) and tested with Opera 10.63 and Opera 9.64. I couldn't reproduce what you reported, as both browsers show the "ok" alert.
You didn't mention which jQuery version you used, so there isn't much I can do to further evaluate this issue. Also consider that Opera 9.23 is an old browser (old as in older then 3 years) and isn't even the latest of the 9.x branch.
Considering all this I'm closing this ticket as invalid, feel free to report back if this issue persists for you with the latest version of jQuery.
---
The next time please provide a link to a test case on http://jsfiddle.net instead of pasting the code in the ticket. Doing that enables us to verify your bug report more quickly.
How to report bugs