Object does not support this property or method error in JQ

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
irfan_sw
Forum Newbie
Posts: 8
Joined: Tue Aug 31, 2010 4:59 am

Object does not support this property or method error in JQ

Post 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.
cpetercarter
Forum Contributor
Posts: 474
Joined: Sat Jul 25, 2009 2:00 am

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

Post 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!
irfan_sw
Forum Newbie
Posts: 8
Joined: Tue Aug 31, 2010 4:59 am

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

Post by irfan_sw »

Thanks very cpetercarter.it solve the problem........Thanks
Post Reply