Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you look at your JavaScript console, you should see a syntax error, as your ajax block is incomplete. You never finish the anonymous function you're passing into <code>each</code> and the closing paren and semi on the <code>each</code> call:</p> <pre><code>success: function (result) { $.each(result, function (key, value) { alert(value.Value); propertyLevelId = value.Value; testing(propertyLevelId);//It doesnt call the function // ===&gt; here &lt;=== }, </code></pre> <p>It helps if you consistently indent your code, so you can see those kinds of typos more easily.</p> <p>Here's a fixed version:</p> <pre><code>function name(roleId) { $.ajax({ url: '../UserManagement/GetRoleLevel' + '/?roleId=' + roleId, type: "POST", dataType: "json", contentType: 'application/json', //async: false, success: function (result) { $.each(result, function (key, value) { alert(value.Value); propertyLevelId = value.Value; testing(propertyLevelId);//It doesnt call the function }); }, complete: function () { }, error: ServiceFailed// When Service call fails }); } </code></pre> <p>As a side note, unless you're declaring <code>propertyLevelId</code> somewhere in an enclosing scope that you haven't shown (I'm not talking about the argument to <code>testing</code> with the same name, I'm talking about the variable you use in your anonymous <code>success</code> function), you're falling prey to <a href="http://blog.niftysnippets.org/2008/03/horror-of-implicit-globals.html" rel="nofollow">The Horror of Implicit Globals</a>.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload