Page 1 of 1

Object does not support this property or method error in JQ

Posted: Tue Nov 02, 2010 4:51 am
by irfan_sw
Hello.
I have created a jquery function.Its working fine in mozile fire fox but creating problem in Internet explorer.
$('#Group').change(function() {
First_name = $("#First_name").val();
Last_name = $("#Last_name").val();
Company = $("#Company").val();
Email = $("#Email").val();
Group = $("#Group").val();


$('#flex1').flexOptions({newp:1, params:[{name:'First_name', value: First_name},{name:'Last_name', value: Last_name},{name:'Company', value: Company},{name:'Email', value: Email},{name:'Group', value: Group}]});
$("#flex1").flexReload();

});

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2)
Timestamp: Tue, 2 Nov 2010 09:50:18 UTC


Message: Object doesn't support this property or method
Line: 236
Char: 1
Code: 0


Plz solve.

Re: Object does not support this property or method error in

Posted: Tue Nov 02, 2010 5:13 am
by cpetercarter
In Javascript, you should declare variables before attempting to use them.

so:

Code: Select all

First_name = $("#First_name").val();
should be

Code: Select all

var First_name = $("#First_name").val();
and so on.

I don't know if this is the cause of your problem, but give it a try!

Re: Object does not support this property or method error in

Posted: Tue Nov 02, 2010 6:38 am
by irfan_sw
Thanks very cpetercarter.it solve the problem........Thanks