INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

no respond when click button to get json data from url in table

no respond when click button to get json data from url in table

no respond when click button to get json data from url in table

(OP)
I have url www.DevuEgypt.com/api/employees i need to display FirstName,Id,Salary in table by click button using jquery
when click button not give me any result and give me two message
I try more time but it give me error
submit handler has fired this is normal to check
error error not found this message show to me
my code as below

CODE --> script

[code]

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>Index</title>

    <script src="~/Scripts/jquery-1.10.2.js"></script>
    <script>
        $(function () {
            $('#btn').click(function () {
               alert("submit handler has fired");
                $.ajax({
                   // type: 'POST',
                    url: 'www.DevuEgypt.com/api/employees',
                    data:{},
                    dataType: 'json',

                    success: function (data) {
                        $.each(data, function (index, value) {
                           var row = $("<tr><td>" + value.FirstName + "</td><td>" + value.Id + "</td><td>" + value.Salary + "</td></tr>");
                          $("#myData").append(row);
                         });
                      
                    },
                   error: function (jqXHR, textStatus, errorThrown) {
                        alert('error: ' + textStatus + ': ' + errorThrown);
                   }
                });
                //return false;//suppress natural form submission
            });
        });
    </script>
</head>
<body>
    <div> 
        <input type="button" value="GetData" id="btn" />
        <table id="myData"></table>
    </div>
</body>
</html> 
[/code]

RE: no respond when click button to get json data from url in table

The URL you posted is only an XML file with no javascript to do anything at all.

And this;

CODE --> javascript

<script src="~/Scripts/jquery-1.10.2.js"></script> 
Will not 'work' on a remote server as '~' refers to the 'home' directory of the logged in user and on a web server, there is no 'logged in user' to have a 'home directory'.

Chris.

Indifference will be the downfall of mankind, but who cares?
Time flies like an arrow, however, fruit flies like a banana.
Webmaster Forum

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close