0

I am posting full code now please check and let me know what i have to modify in this code to solve this problem in IE:

var values = [];
$("#tblitem  #itm").each(function(a, b)
{
values[a] = b.text;
});

valuex[x] is used to fetch itemname here.and below i used it in indexof().indexof() is working well before i use array.problem occurs after the use of array only in IE.

var compare_value_oldd="$500";
var compare_value_neww=parseFloat(compare_value_oldd.replace(/[^0-9-.]/g,''));

 for( var x in values)
 {

if (parseFloat(totalnumm.replace(/[^0-9-.]/g,'')) > compare_value_neww    &&    values[x].indexOf("Custom") > -1 )


  {

if ($.cookie('test_status1') != '2') 

{

              $('#element_to_pop_up1').bPopup({
                  content: 'image', //'ajax', 'iframe' or 'image'
                  contentContainer: '.content',
                  loadUrl: 'coupon.jpg'
              });


 <!--cookie settings here-->
 <!--expire time of cookie is 30 days.you can change it as per your requirements-->

            $.cookie('test_status1', '2', { expires: 30 });


 }

 }

 }

I got error in this line.

  **if (parseFloat(totalnumm.replace(/[^0-9-.]/g,'')) > compare_value_neww    &&    values[x].indexOf("Custom") > -1 )**
Yotam Omer
  • 15,310
  • 11
  • 62
  • 65
honey
  • 13
  • 1
  • 1
  • 5

1 Answers1

0

You should wrap element inside jquery object:

var values = [];
$("#tblitem  #itm").each(function(a, b)
{
   values[a] = $(b).text();
});

I don't know which kind of element is '#itm', you could have to use $(b).html(); or $(b).val();

A. Wolff
  • 74,033
  • 9
  • 94
  • 155
  • roasted i am new to jquery so please tell me what i have to modify here..i will be highly thankful – honey May 28 '13 at 09:52
  • i am not getting you said "wrap element inside jquery object:" please – honey May 28 '13 at 09:53
  • Ok, honey, you should take some initiative and try to understand what other users post. $(b) means that DOM elment (here b) is wrapped inside jquery object! Have you try the snippet i have posted? And please don't tell me $(b).text; is not working because as you can read it is: $(b).text(); I just anticipate your next question... – A. Wolff May 28 '13 at 09:56
  • And then? Sorry to be so rude but have you got any initiative? I mean how someone could help you if you give just piece of info about your problem? So, let me ask you a question: is it working or not? If not, have you got some error? If error, which error?... Is it so hard to understand??? – A. Wolff May 28 '13 at 10:08
  • Object doesn't support property or method 'text' – honey May 28 '13 at 10:16
  • You said: "$(b).text() show strings like custom". And now you say: "Object doesn't support property or method 'text' " I'm completly confused! Please, consider to find someone else to help you, i give up! – A. Wolff May 28 '13 at 10:20