Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: PHP jQuery
$.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 17-Feb-13 3:44am
Edited 17-Feb-13 3:53am
ProgramFOX122.8K
v3
Comments
Shahare at 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 at 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

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

$.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 Big Grin | :-D .....Function ends before executing else part... Big Grin | :-D
  Permalink  
v2

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

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 458
1 OriginalGriff 384
2 George Jonsson 233
3 Animesh Datta 130
4 Shemeemsha RA 128
0 OriginalGriff 6,179
1 Sergey Alexandrovich Kryukov 5,616
2 CPallini 4,770
3 George Jonsson 3,400
4 Gihan Liyanage 2,522


Advertise | Privacy | Mobile
Web03 | 2.8.140916.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100