Click here to Skip to main content
15,887,898 members
Home / Discussions / JavaScript
   

JavaScript

 
GeneralRe: using ajax Pin
Member 113542639-Feb-15 13:30
Member 113542639-Feb-15 13:30 
QuestionWhat is an AXD file Pin
indian1433-Feb-15 14:58
indian1433-Feb-15 14:58 
AnswerRe: What is an AXD file Pin
Richard Deeming4-Feb-15 2:17
mveRichard Deeming4-Feb-15 2:17 
GeneralRe: What is an AXD file Pin
indian1434-Feb-15 6:20
indian1434-Feb-15 6:20 
GeneralRe: What is an AXD file Pin
Richard Deeming4-Feb-15 6:39
mveRichard Deeming4-Feb-15 6:39 
GeneralRe: What is an AXD file Pin
indian1434-Feb-15 6:52
indian1434-Feb-15 6:52 
QuestionHow to make ondrop event being invoked by mouseover? Pin
Member 113783023-Feb-15 6:12
Member 113783023-Feb-15 6:12 
QuestionCalling an ASMX Web Service through JQuery .Ajax Pin
dbrenth2-Feb-15 10:44
dbrenth2-Feb-15 10:44 
The following is my HTML page. My problem is with invokeService(). It correctly determines the body and places it in data - but then it never sends the data. Fiddler shows no JSON data was sent. The Success routine is called but the data is null (as would be expected with no input data).

Can anyone tell me what I am missing or did wrong. How do I send the JSON to the service?

Thanks Brent

HTML
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>Test Voter Info</title>
    <script type="text/javascript" src="jquery-1.4.1.js"></script>

    <script type="text/javascript">

        function invokeService() {
            var value = document.getElementById("voter").value;
            var loc = "https://www.voterfocus.com/mais/asmx/service1.asmx";
            var body = "{'FVRSVoterIDNumber':'" + value + "', 'County':'lee', 'CKey':'------'}";
            input.innerText = body;
            $.ajax({
                type: "POST",
                url: loc + "/GetFVRSVoter",
                data: body,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: ajaxSucceeded,
                error: ajaxFailed
            });

        }

        function ajaxFailed(data) {
            result.innerText = data.status + ' ' + data.statusText;
        }

        function ajaxSucceeded(data) {
            if (data != null)
                result.innerText = data.d;
            else
                result.innerText = data;
        }
    </script>

</head>
<body>
    <div style="width:100%; border: solid; margin: 2px; overflow: auto; height: 100px;">
        One Voter: <input type="text" id="voter" />
        <input type="button" onclick="invokeService();" value="GO" />
    </div>
    Input Body:
    <div id="input" style="width:100%; border: solid; margin: 2px; overflow: auto; height: 190px;">
    </div>
    Raw Result:
    <div id="result" style="width:100%; border: solid; margin: 2px; overflow: auto; height: 300px;">
    </div>
</body>
</html>

Brent

QuestionRe: Calling an ASMX Web Service through JQuery .Ajax Pin
ZurdoDev2-Feb-15 11:00
professionalZurdoDev2-Feb-15 11:00 
AnswerRe: Calling an ASMX Web Service through JQuery .Ajax Pin
dbrenth3-Feb-15 2:28
dbrenth3-Feb-15 2:28 
QuestionRe: Calling an ASMX Web Service through JQuery .Ajax Pin
ZurdoDev3-Feb-15 2:30
professionalZurdoDev3-Feb-15 2:30 
AnswerRe: Calling an ASMX Web Service through JQuery .Ajax Pin
dbrenth3-Feb-15 2:57
dbrenth3-Feb-15 2:57 
GeneralRe: Calling an ASMX Web Service through JQuery .Ajax Pin
ZurdoDev3-Feb-15 3:02
professionalZurdoDev3-Feb-15 3:02 
GeneralRe: Calling an ASMX Web Service through JQuery .Ajax Pin
dbrenth3-Feb-15 5:14
dbrenth3-Feb-15 5:14 
GeneralRe: Calling an ASMX Web Service through JQuery .Ajax Pin
ZurdoDev3-Feb-15 5:34
professionalZurdoDev3-Feb-15 5:34 
AnswerRe: Calling an ASMX Web Service through JQuery .Ajax Pin
Richard Deeming4-Feb-15 2:12
mveRichard Deeming4-Feb-15 2:12 
QuestionAsp.net cross-page postback Pin
BobbyStrain31-Jan-15 6:04
BobbyStrain31-Jan-15 6:04 
QuestionAdding client validations on run time using jQuery Pin
indian14330-Jan-15 7:52
indian14330-Jan-15 7:52 
AnswerRe: Adding client validations on run time using jQuery Pin
Member 113784301-Feb-15 14:25
Member 113784301-Feb-15 14:25 
GeneralRe: Adding client validations on run time using jQuery Pin
indian14311-Feb-15 13:11
indian14311-Feb-15 13:11 
Questionpopup box not working Pin
Member 1141289229-Jan-15 10:23
Member 1141289229-Jan-15 10:23 
QuestionListBox Dropdown is displaying items only after blur Pin
indian14328-Jan-15 8:27
indian14328-Jan-15 8:27 
GeneralRe: ListBox Dropdown is displaying items only after blur Pin
jkirkerx29-Jan-15 7:51
professionaljkirkerx29-Jan-15 7:51 
GeneralRe: ListBox Dropdown is displaying items only after blur Pin
indian1433-Feb-15 14:48
indian1433-Feb-15 14:48 
GeneralRe: ListBox Dropdown is displaying items only after blur Pin
jkirkerx4-Feb-15 6:33
professionaljkirkerx4-Feb-15 6:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.