2014-08-29 60 views
0

嘿,我有一段代碼,我已經三天試圖從中拉一點點數據。Javascript Array對象和值

我知道這裏有很多代碼,但我需要的是我的(更改)名稱,在這種情況下,最後一個數組對象是William Adama。

我將不勝感激任何幫助,因爲我已經三天試圖找出它,並且我在JavaScript中可怕。

<script type="text/javascript"> 

function applyArguments(){ 
    Ext.BLANK_IMAGE_URL = '/s.gif'; 
    Ext.SSL_SECURE_URL = 's.gif'; 
    Ext.ns('acronym.ngoe.args'); 
    Ext.apply(acronym.ngoe, { 
     soaUrl: './', 
     //Global Service Url (terminate with '/' !!) 
     scSoaUrl: '/crm/', 
     sbpdatapath: '/SupportbyProduct/', 
     basepath: '', 
     assetsUrl: '/ngoeSitecacheDocs/', 
     localeString: 'en_US', 
     systemurl: '/', 
     jsonUrl: '/ngoeSitecacheDocs/en_US/', 
     jsonUrlExtended: '/ngoeSitecacheDocs/en_US/pages/support_zone_web_assets/products/', 
     loginsystemurl: 'https://sso.acronym.com/', 
     talismaChatUrl: 'https://chatlb.acronym.com/NaRouter/nadispatch.aspx', 
     attachmentsUrl: 'https://fileservice.acronym.com/AttachmentsV3/Index.aspx', 
     freemarkercontextpath: '/', 
     downloadsdatapath: '/downloads/', 
     downloadsUrl: 'http://nglznddev01.isus.acronym.com/downloads/', 
     emailAddress: '[email protected]', 
     viewandManageSRUrl: '/crm/srManagement/', 
     orderACRUUrl: '/crm/orderPart', 
     administersiteUrl: '/crm/sites/', 
     dnllandingUrl: '/downloads/', 
     licenseUrl: '/crm/license/', 
     createSRUrl: '/crm/createSR/', 
     chatUrl: '/crm/liveChat/', 
     forumUrl: '/community/', 
     sclandingUrl: '/crm/', 
     releaseAndEndOfLifeDatesCustomer: 'http://protectedlink.acronym.com/someappname', 
     releaseAndEndOfLifeDatesPartner: 'http://protectedlink.acronym.com/someappname&internalId=0b01406680021db6&_irrt=true', 
     releaseAndEndOfLifeDatesEmployee: 'http://protectedlink.acronym.com/someappname&internalId=0b014066800251dd&_irrt=true', 
     sbpIssuesPowerlinkCustomerUrl:'http://protectedlink.acronym.com/someappname&internalId=0b014066800a8d8f&_irrt=true', 
     sbpIssuesPowerlinkPartnerUrl:'http://protectedlink.acronym.com/someappname&internalId=0b014066800a9053&_irrt=true', 
     sbpIssuesPowerlinkEmployeeUrl:'http://protectedlink.acronym.com/someappname&internalId=0b014066800a9053&_irrt=true', 
     chatViewAllUrl:'https://community.acronym.com/docs/DOC-XXXXX', 
     isNewLiveChat:'true', 
     showContentSubscriptions: 'false', 
     communityIFIUrl: 'https://sso.acronym.com/sso/ifi/ifiProcessor?initiatingURL=https://community.acronym.com/communitysupport/' 

    }); 

    acronym.ngoe.args = { 
     disableOverlays: true, 
     preloadOverlays: false, 
     enableSessionNotification: true, 
     sessionNotificationInMin: 240, 
     sessionGracePeriodInMin: 3, 
     sessionUpdateNotification: 2, 
     sortBy: '0', 
     showSubscriptions: 'true', 
     eliteAccess : 'true', 
     ecpsAccess : 'true', 
     ecpsPocAccess : 'true', 
     enableSupportIcon : 'true', 
     mySupportUrl : '/myproducts/', 
     myProductsMenuItemVisible : 'true', 
     chatInterval : 30, 
     chatNonSelectedIntervalInSecs: 90, 
     chatNonSelectedMaxCycles: 4, 
     sfdcAuthorPageUrl : 'https://acronym.my.sforce.net.com/knowledge/publishing/knowledgePublishingHome.apexp', 
     sfdcAccessLevelCheck : 'true', 
     rcmCodeKey : 'ACRONYM_ONSITE_REASON_FOR_RCM' 

    }; 
    Ext.apply(acronym.ngoe.args, {"userData":{"title":"Tech Support Engineer I IRL","uid":"138942","firstName":"William","lastName":"Adama","preferredLocale":"en_US","loginName":"adamaw3","siteDuns":null,"parentDuns":null,"phoneNumber":"353851234567","identityType":"E","customerType":null,"companyName":"","accessLevel":50,"email":"[email protected]","givenname":"William","isCRMUser":true,"customerProgram":null,"subscribenetMemberID":null,"globalDuns":null,"localeLang":"en","localeCountry":"US","flname":"William Adama","sfdcUserType":"Platform User"},"docsPerPage":"50"}); 
    Ext.apply(acronym.ngoe.args, {"supportBean":{"readOnly":false,"firstName":"William","lastName":"Adama","entityId":null,"partyId":27132777,"siteDuns":null,"userId":452198,"respId":58727,"respAppId":514,"sites":null,"userFlag":"E","crmUser":true,"groupId":null,"resourceId":100499257,"phoneNumber":null,"emailAddress":null,"powerlinkId":"138942","requestType":null,"supportFlag":null,"empFlag":null,"personId":400710,"relPartyId":null,"emailPointId":null,"phonePointId":null,"admin":false,"agent":false,"adminPartyId":null,"relationshipCode":null,"relationshipType":null,"requestUser":null,"entitledDuns":null,"roleName":null,"identifyType":null,"phoneCountryCode":"null","phoneAreaCode":"null","dialOutAccess":true,"userSupportedCountry":"IE"}}); 
    Ext.apply(acronym.ngoe.args, {"neoBeanData":{"notes":null,"chatType":null,"serialNo":null,"defectivepartNo":null,"defectivepartserialNo":null,"sline":null}}); 

    acronym.ngoe.arguments = acronym.ngoe.args;} 
</script> 

回答

0

在這裏,Ext並沒有真正發揮很大的作用,只是使用一些快捷方式來指定對象屬性。

無論如何,你會與訪問:

console.log(acronym.ngoe.args.userData.firstName); 
console.log(acronym.ngoe.args.userData.lastName); 
+0

哇。我不能夠感謝你@Evan !!! – ninjaholic 2014-09-02 08:27:11