tags:

views:

29

answers:

2

i have this code:

<script>
$("#mod").change(function() {
 var matches=str.match(/(EE|[EJU]).*(D)/i);
         $.ajax({
                  type="post",
                  url="process.php",
                  data="matches",
                  cache=false,
                  async=false,
                  success= function(res){
                         $('#rslt').replaceWith("<div id='value'><h6>Tuner range is" + res + " .</h6></div>");
                         return this;
                 }
         });
   return false;
});
 </script>

i want this code can show the result normally..where is my fault?

+2  A: 

remove the returns

and format as ( : instead of = )

         $.ajax({
                  type:"post",
                  url:"process.php",
                  data:"matches=" + matches,
                  cache:false,
                  async:false,
                  success: function(res){
                         $('#rslt').replaceWith("<div id='value'><h6>Tuner range is" + res + " .</h6></div>");
                         // return this; <<--- remove that too...
                 }
         })

and if you want matches to be passed as data use data:"matches=" + matches,...

and $_POST['matches'] is the way to get the value via PHP

Reigel
+1 - glad you understood what the OP meant, lol
Dan Heberden
thank's a lot Reigel..
klox
i hope people read the documentation first. what is the term.... RTFM(Read The Fuc*ing Manual)? lolz...
Ayaz Alavi
@Ayaz - well, klox was really learnng... you can see it in his olders post... he did RTFM it... but he did not get it so he ask... what's wrong with that? someday you might be in his feet...
Reigel
@ayaz-sorry if u don't like with my question..i'm really a beginner in programming and this community is the first step for me to learn how making a web..@Reigel-thanks for your help..Ganbatte!!
klox
A: 
<script>
$("#mod").change(function() {
 var matches=str.match(/(EE|[EJU]).*(D)/i);
         $.ajax({
                  type:"post",
                  url:"process.php",
                  data:"matches="+matches,
                  cache:false,
                  async:false,
                  success: function(res){
                         $('#rslt').replaceWith("<div id='value'><h6>Tuner range is" + res + " .</h6></div>");

                   }
         });
  });
 </script>
klox