Click here to Skip to main content
15,921,989 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
JavaScript
$.get(
            "ajax.php",
            {dta:val1},
  function(data1)
          {
           if(data1.msg1!=null)
            {
           alert(val1);
         
         
          $('#div10').text(data1.msg1);
         
          }
            } 
          else
          {
          alert('sosool')
             }
          }  , 'json'
            );






Why else the code will not run?
What is the problem?
tnx

[Edit]Code block added[/Edit]
Posted
Updated 17-Feb-13 3:53am
v3
Comments
Shahare 17-Feb-13 9:54am    
Maybe because the code here is not complete :)
Tried to copy your code above and it does not look good - if this is all the code use indentation to make it look right and you`ll see your problem
Sergey Alexandrovich Kryukov 17-Feb-13 12:19pm    
Maybe because you reflect '?' in the mirror? :-)

You see, such questions cannot be valid in principle. "Not run" is not anything certain. You need to tell us what did you try to achieve, what did you expect from the code you show, what do you observe instead and why do you think it's wrong...
—SA

1 solution

$.get(
            "ajax.php",
            {dta:val1},
  function(data1)
          {
           if(data1.msg1!=null)
            {
           alert(val1);
         
         
          $('#div10').text(data1.msg1);
         
          
            } 
          else
          {
          alert('sosool')
             }
          }  , 'json'
            );


One extra curly brace :D .....Function ends before executing else part... :D
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900