Click here to Skip to main content
12,397,380 members (63,974 online)
Rate this:
 
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
Updated 17-Feb-13 3:53am
ProgramFOX184.9K
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

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
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 18 Feb 2013
Copyright © CodeProject, 1999-2016
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