jquery-val-method-throwing-error
-
Gabriel Jürgens
- Assigned user set to Thatcher
- Tag changed from jquery val to jquery val, htmloptionelement
Hi! I think i'm having a problem related with this issue, but without using jQuery.
Here is an example that throws a "Cannot find function add" error when running in Rhino:
<option value="1">One</option>//JavaScript var oSelect = document.getElementById('oSelect');
var oOption = document.createElement('OPTION');
// Add the option to the collection first, then set properties oSelect.options.add(oOption);
oOption.innerHTML = "Two";
oOption.value = "2";I will try to make some more debugging and see if I can give you more info about this issue.
Thanks for your great work, and sorry about my bad english!
Gabriel -
Gabriel Jürgens
Sorry about my previous post!
I'm a newie using lighthouse, and didn't saw the code snipplet, so here is again:
<select id="oSelect"> </select> <script type="text/javascript"> var oSelect = document.getElementById('oSelect'); oSelect.options[0] = new Option("ONE",1); oSelect.options[1] = new Option("TWO",2); alert(oSelect.options[1].value); </script>when I run this at Rhino using "env.rhino.js", I get this error:
[ Envjs/1.6 (Rhino; U; Windows XP x86 5.1; en-US; rv:1.7.0.rc2) Resig/20070309 PilotFish/1.2.13 ] error loading script [object HTMLScriptElement] TypeError: Cannot read property "value" from undefinedThis example runs fine on Firefox, IE7, IE6, and Chrome, so I think it's an Envj issue.
Sorry about my previous post!
Thanks,
Gabriel -
Thatcher
Thanks Gabriel,
I'll integrate this into our unit tests and track down the issue. I expect
it will be relatively easy to find given the good test case!
Thatcher
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.