Follow Fantora on Twitter
Fantora Word of Classified Ads and Community Forum
Welcome Guest Search | Active Topics | Members | Log In | Register

passing ?? in ajax web service call

Options
adam
Posted: Friday, February 03, 2012 9:24:47 AM
Rank: Advanced Member
Groups: Member

Joined: 4/3/2008
Posts: 185
Points: 561
Location: London

passing ?? in ajax web service call

I cannot pass ?? as data in a JSON object to a web service. One ? will save - two (??) will not. Code is this

Code:
function submitAjax(strService, objWebParam, sender, fncFinished) {
    var objSubmit = {};
    mergeObjects(objSubmit, objWebParam);
    clearWebParam(objSubmit);
    var strWebParam = $.toJSON(objSubmit);
    $.ajax({
        type: "POST",
        url: "WebService.asmx/" + strService,
        dataType: "json",
        data: strWebParam,
        contentType: "application/json; charset=utf-8",
        success: function(msg) {
            fncFinished(msg, sender, objWebParam);
        },
        failure: function(msg) {
            fncFinished(msg, "failure", objWebParam);
        },
        error: function(msg) {
            fncFinished(msg, "error", objWebParam);
        }
    });
}


It breaks at error: - and msg looks like...

The readyState is coming back as a 4 and the statusText is coming back as "parseerror"

Interestingly I'm passing in "a??" as the data

AdjNote "a??"
- and the "parseerror" is coming back with the "a??" changed to

"AdjNote\":\"ajQuery152049188124233372654_1328136774279\"
ca4nul
Posted: Friday, February 03, 2012 9:26:02 AM
Rank: Advanced Member
Groups: Member

Joined: 11/9/2007
Posts: 560
Points: 1,011
Location: GB

passing ?? in ajax web service call

This problem was fixed in jQuery 1.7.1 - I was using 1.5

adam wrote:
I cannot pass ?? as data in a JSON object to a web service. One ? will save - two (??) will not. Code is this

Code:
function submitAjax(strService, objWebParam, sender, fncFinished) {
    var objSubmit = {};
    mergeObjects(objSubmit, objWebParam);
    clearWebParam(objSubmit);
    var strWebParam = $.toJSON(objSubmit);
    $.ajax({
        type: "POST",
        url: "WebService.asmx/" + strService,
        dataType: "json",
        data: strWebParam,
        contentType: "application/json; charset=utf-8",
        success: function(msg) {
            fncFinished(msg, sender, objWebParam);
        },
        failure: function(msg) {
            fncFinished(msg, "failure", objWebParam);
        },
        error: function(msg) {
            fncFinished(msg, "error", objWebParam);
        }
    });
}


It breaks at error: - and msg looks like...

The readyState is coming back as a 4 and the statusText is coming back as "parseerror"

Interestingly I'm passing in "a??" as the data

AdjNote "a??"
- and the "parseerror" is coming back with the "a??" changed to

"AdjNote\":\"ajQuery152049188124233372654_1328136774279\"
Users browsing this topic
Guest

 Related
Ultimate Regular Expression Library
blue Dots apearing for spaces in the pages
Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
Commerce server 2009 Basket Only Extension
run CS 2007 code on 2009 R2. Where is Microsoft.CommerceServer.Runtime
Error in Unpacking Data warehouse : Cannot connect to Analysis Services version '10.0.4000.0'
Is it possible to do CatalogSearch without any sort property?
using named Instance of sql server in Commerce Server 2009 Datawarehouse
how to Call web service through HTTP
The module 'CommerceProfileModule' depends on the site resource 'Biz Data Service' which does not exist in the Commerce Server a
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Fantora Blog | Discount Shop UK | Discount Shop USA | Discount Shop Canada | Discount Boutique France | Discount Shop Deutschland | Discount Shop Italia | Descuento Shop España

Free Classified ads, Webmaster Forum & Technology Reviews | Fantora Free Classified Ads | Buy & Sell Electronics, Mobile phones & Accessories | fantora Forums Community | Buy & Sell DVD, Games and Consols | Free eBooks & Softwares | SEO & Affiliate Marketing Discussion | Programming Language Forum (.NET, ASP, PHP, SQL) | Free Classified Ads | General Stuff (Movies, Chat, Comics) | Free Online English Movies & Reviews | Free Online Hindi Movies & Reviews | Australia & New Zealand Immigration Forum | Europe immigration forum | Canada Immigration Forum | Ireland Immigration Forum | US Immigration Forum | United Kingdom Immigration Forum

Main Forum RSS : RSS

Powered by: YAF.NET
Copyright © AI Logica All rights reserved.
This page was generated in 0.157 seconds.