Click here to Skip to main content
15,890,717 members
Home / Discussions / JavaScript
   

JavaScript

 
QuestionLooking for a candian that has regex down for canadian postal codes Pin
jkirkerx3-Mar-13 12:54
professionaljkirkerx3-Mar-13 12:54 
AnswerRe: Looking for a candian that has regex down for canadian postal codes Pin
Peter_in_27803-Mar-13 13:26
professionalPeter_in_27803-Mar-13 13:26 
GeneralRe: Looking for a candian that has regex down for canadian postal codes Pin
jkirkerx3-Mar-13 13:44
professionaljkirkerx3-Mar-13 13:44 
QuestionGetting child json elements Pin
jkirkerx3-Mar-13 9:09
professionaljkirkerx3-Mar-13 9:09 
AnswerRe: Getting child json elements Pin
Graham Breach3-Mar-13 10:01
Graham Breach3-Mar-13 10:01 
GeneralRe: Getting child json elements Pin
Garth J Lancaster3-Mar-13 10:26
professionalGarth J Lancaster3-Mar-13 10:26 
GeneralRe: Getting child json elements Pin
jkirkerx3-Mar-13 10:50
professionaljkirkerx3-Mar-13 10:50 
GeneralRe: Getting child json elements [solved] Pin
jkirkerx3-Mar-13 10:48
professionaljkirkerx3-Mar-13 10:48 
I didn't know about the parsed function.

I ended up taking out the square brackets and revalidating the output, and grabbing the result as a non-array.

Just finished the implementation, but I do need to create a true json array in the next project on my to-do list.

Well thanks from brushing the rust off my head, it's been awhile and I completely blanked out on that one.

{
    "result_StatusCode": 0,
    "result_StatusMessage": "Success",
    "result_WarningMessage": {
        "Message": "Ship To Address Classification is changed from Residential to Commercial"
    },
    "result_API_Code": "12",
    "result_API_Name": "UPS Three-Day Select®",
    "result_Billing_SurCharge_Value": "$0.00",
    "result_Billing_SurCharge_Currency": "USD",
    "result_Billing_NetCharge_Value": "$8.29",
    "result_Billing_NetCharge_Currency": "USD",
    "result_Billing_Weight_Value": "01",
    "result_Billing_Weight_UnitType": "LBS",
    "result_ShipDate": "",
    "result_DayOfWeek": "",
    "result_DeliveryDate": "",
    "result_Error": {
        "ErrorSeverity": "Hard",
        "ErrorCode": "111211",
        "ErrorDescription": "The requested accessory option is unavailable between the selected locations."
    }
}


var objB = jQuery.parseJSON(UPS.d);

var result_StatusCode = objB.result_StatusCode;
var result_Message = objB.result_StatusMessage;
var result_WarningMessage = objB.result_WarningMessage;
var result_API_Code = objB.result_API_Code;
var result_API_Name = objB.result_API_Name;
var result_Billing_SurCharge_Value = objB.result_Billing_SurCharge_Value;
var result_Billing_SurCharge_Currency = objB.result_Billing_SurCharge_Currency;
var result_Billing_NetCharge_Value = objB.result_Billing_NetCharge_Value;
var result_Billing_NetCharge_Currency = objB.result_Billing_NetCharge_Currency;
var result_Billing_Weight_Value = objB.result_Billing_Weight_Value;
var result_Billing_Weight_UnitType = objB.result_Billing_Weight_UnitType;
var result_ShipDate = objB.result_ShipDate;
var result_DayOfWeek = objB.result_DayOfWeek;
var result_DeliveryDate = objB.result_DeliveryDate;

// 0 for failure - 1 for Success
// We will get a 1 back on a successful transaction
if (0 == result_StatusCode) {

    var result_Error = objB.result_Error;
    var e_Severity = result_Error.ErrorSeverity;
    var e_Code = result_Error.ErrorCode;
    var e_Description = result_Error.ErrorDescription;
    var m_Error_Text = result_API_Name + " -- " + "ERROR";
    $('option:selected', '[id*="_ddl_RTSR_SARates_Unified_SelectRate"]').text(m_Error_Text);
    $('[id*="_lbl_RTSR_Status"]').text(e_Description);
    $('[id*="_lbl_RTSR_OrderInformation_EstimatedRate_Field"]').text("ERROR " + e_Code);

QuestionResetting drop downs inside of a div Pin
Aptiva Dave27-Feb-13 11:04
Aptiva Dave27-Feb-13 11:04 
AnswerRe: Resetting drop downs inside of a div Pin
ZurdoDev6-Mar-13 1:24
professionalZurdoDev6-Mar-13 1:24 
Questionhtml5 and java script Pin
Manoranjan Gupta23-Feb-13 2:09
Manoranjan Gupta23-Feb-13 2:09 
AnswerRe: html5 and java script Pin
Richard MacCutchan23-Feb-13 2:16
mveRichard MacCutchan23-Feb-13 2:16 
AnswerRe: html5 and java script Pin
twseitex8-Mar-13 9:12
twseitex8-Mar-13 9:12 
QuestionHigh Stock Pin
bahar_Agi20-Feb-13 8:33
bahar_Agi20-Feb-13 8:33 
AnswerRe: High Stock Pin
Sandeep Mewara20-Feb-13 16:56
mveSandeep Mewara20-Feb-13 16:56 
Questioncopy one file from a folder to another folder with JS Pin
hasThisNameBeen19-Feb-13 22:38
hasThisNameBeen19-Feb-13 22:38 
AnswerRe: copy one file from a folder to another folder with JS Pin
Sandeep Mewara20-Feb-13 17:10
mveSandeep Mewara20-Feb-13 17:10 
GeneralRe: copy one file from a folder to another folder with JS Pin
ZurdoDev21-Feb-13 1:51
professionalZurdoDev21-Feb-13 1:51 
GeneralRe: copy one file from a folder to another folder with JS Pin
Sandeep Mewara21-Feb-13 2:15
mveSandeep Mewara21-Feb-13 2:15 
GeneralRe: copy one file from a folder to another folder with JS Pin
dusty_dex27-Feb-13 14:14
dusty_dex27-Feb-13 14:14 
Questionjavascript Pin
NAVNEET KUMAR SINGH18-Feb-13 18:45
NAVNEET KUMAR SINGH18-Feb-13 18:45 
AnswerRe: javascript Pin
Rahul Rajat Singh18-Feb-13 23:52
professionalRahul Rajat Singh18-Feb-13 23:52 
AnswerRe: javascript Pin
ZurdoDev19-Feb-13 2:37
professionalZurdoDev19-Feb-13 2:37 
QuestionJavaScript run slow with Ipad iOS 6 Pin
kornkimhour13-Feb-13 22:59
kornkimhour13-Feb-13 22:59 
QuestionJavaScript: How to reference user control inside content page? Pin
Tesic Goran12-Feb-13 20:36
professionalTesic Goran12-Feb-13 20:36 

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.