- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 php 文件,可以将对象的 json 字符串发送到我的 javascript 文件。我在访问此 javascript 对象中包含的对象的属性时遇到问题。
我的 php 文件:
for($i=0; $i<$hitcount; $i++){
if($i == $hitcount-1){
// IF HITCOUNT IS LESS THAN 25 RESULTS
echo json_encode($articleArray);
exit();
}else if($i == 25){
// THERE IS ONLY A MAX OF 25 RESULTS PER REQUEST
echo json_encode($articleArray);
exit();
}else{
$page = $xml -> request -> page ; //always page 1
$title = $xml ->resultList -> result[$i] -> title;
if($title == false){
$title = '';
}
$pmid = $xml ->resultList -> result[$i] -> pmid;
if($pmid == false){
$pmid = '';
}
$authorString = $xml ->resultList -> result[$i] -> authorString;
if($authorString == false){
$authorString ='';
}
$journalTitle = $xml ->resultList -> result[$i] -> journalTitle ;
if($journalTitle ==false){
$journalTitle = '';
}
$pubYear = $xml ->resultList -> result[$i] -> pubYear;
if($pubYear == false){
$pubYear = '';
}
$journalVolume = $xml ->resultList -> result[$i] -> journalVolume;
if($journalVolume == false){
$journalVolume = '';
}
$issue = $xml ->resultList -> result[v] -> issue;
if($issue == false){
$issue = '';
}
$pageInfo = $xml ->resultList -> result[$i] -> pageInfo;
if($pageInfo == false){
$pageInfo = '';
}
$articleArray[] = array(
'hitCount' => $hitcount,
'page' => $page,
'pmid' => $pmid,
'title' => $title,
'authors' => $authorString,
'journalTitle' => $journalTitle,
'pubYear' => $pubYear,
'journalVolume' => $journalVolume,
'issue' => $issue,
'pageInfo' => $pageInfo
);
}
}
我的 javascript 文件:
// Retrieve json string
var json_obj = JSON.parse(xmlhttp.responseText);
我尝试了以下方法来访问存储在 javascript 对象中的对象的属性:
json_obj[0].title // to access the title of the first object
这只是返回:
[object Object]
xmlhttp.responseText:
[{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25745995"},"title":{"0":"Hypoxia upregulates Rab11-family interacting protein 4 through HIF-1\u03b1 to promote the metastasis of hepatocellular carcinoma."},"authors":{"0":"Hu F, Deng X, Yang X, Jin H, Gu D, Lv X, Wang C, Zhang Y, Huo X, Shen Q, Luo Q, Zhao F, Ge T, Zhao F, Chu W, Shu H, Yao M, Fan J, Qin W."},"journalTitle":{"0":"Oncogene"},"pubYear":{"0":"2015"},"journalVolume":"","issue":"","pageInfo":""},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25800835"},"title":{"0":"Kinetic activation of Rab8 guanine nucleotide exchange factor Rabin8 by Rab11."},"authors":{"0":"Feng S, Wu B, Per\u00e4nen J, Guo W."},"journalTitle":{"0":"Methods Mol Biol"},"pubYear":{"0":"2015"},"journalVolume":{"0":"1298"},"issue":"","pageInfo":{"0":"99-106"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"26032412"},"title":{"0":"Structure-Function Analyses of the Interactions Between Rab11 and Rab14 Small GTPases with their Shared Effector Rab Coupling Protein (RCP)."},"authors":{"0":"Lall P, Lindsay A, Hanscom S, Kecman T, Taglauer ES, McVeigh UM, Franklin E, McCaffrey MW, Khan AR."},"journalTitle":{"0":"J Biol Chem"},"pubYear":{"0":"2015"},"journalVolume":"","issue":"","pageInfo":""},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25815277"},"title":{"0":"Rab11 in disease progression."},"authors":{"0":"Bhuin T, Roy JK."},"journalTitle":{"0":"Int J Mol Cell Med"},"pubYear":{"0":"2015"},"journalVolume":{"0":"4"},"issue":"","pageInfo":{"0":"1-8"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25800843"},"title":{"0":"In vitro and in vivo characterization of the Rab11-GAP activity of Drosophila Evi5."},"authors":{"0":"Laflamme C, Emery G."},"journalTitle":{"0":"Methods Mol Biol"},"pubYear":{"0":"2015"},"journalVolume":{"0":"1298"},"issue":"","pageInfo":{"0":"187-194"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"24917558"},"title":{"0":"Vasodilator-stimulated phosphoprotein promotes activation of hepatic stellate cells by regulating Rab11-dependent plasma membrane targeting of transforming growth factor beta receptors."},"authors":{"0":"Tu K, Li J, Verma VK, Liu C, Billadeau DD, Lamprecht G, Xiang X, Guo L, Dhanasekaran R, Roberts LR, Shah VH, Kang N."},"journalTitle":{"0":"Hepatology"},"pubYear":{"0":"2015"},"journalVolume":{"0":"61"},"issue":"","pageInfo":{"0":"361-374"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25480917"},"title":{"0":"Vangl2 cooperates with Rab11 and Myosin V to regulate apical constriction during vertebrate gastrulation."},"authors":{"0":"Ossipova O, Chuykin I, Chu CW, Sokol SY."},"journalTitle":{"0":"Development"},"pubYear":{"0":"2015"},"journalVolume":{"0":"142"},"issue":"","pageInfo":{"0":"99-107"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25831508"},"title":{"0":"TRAPPII regulates exocytic Golgi exit by mediating nucleotide exchange on the Ypt31 ortholog RabERAB11."},"authors":{"0":"Pinar M, Arst HN Jr, Pantazopoulou A, Tagua VG, de los R\u00edos V, Rodr\u00edguez-Salarichs J, D\u00edaz JF, Pe\u00f1alva MA."},"journalTitle":{"0":"Proc Natl Acad Sci U S A"},"pubYear":{"0":"2015"},"journalVolume":{"0":"112"},"issue":"","pageInfo":{"0":"4346-4351"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25305083"},"title":{"0":"Rab11 modulates \u03b1-synuclein-mediated defects in synaptic transmission and behaviour."},"authors":{"0":"Breda C, Nugent ML, Estranero JG, Kyriacou CP, Outeiro TF, Steinert JR, Giorgini F."},"journalTitle":{"0":"Hum Mol Genet"},"pubYear":{"0":"2015"},"journalVolume":{"0":"24"},"issue":"","pageInfo":{"0":"1077-1091"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25862161"},"title":{"0":"A novel role of Rab11 in trafficking GPI-anchored trans-sialidase to the plasma membrane of Trypanosoma cruzi."},"authors":{"0":"Niyogi S, Docampo R."},"journalTitle":{"0":"Small GTPases"},"pubYear":{"0":"2015"},"journalVolume":{"0":"6"},"issue":"","pageInfo":{"0":"8-10"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25673879"},"title":{"0":"The Arf and Rab11 effector FIP3 acts synergistically with ASAP1 to direct Rabin8 in ciliary receptor targeting."},"authors":{"0":"Wang J, Deretic D."},"journalTitle":{"0":"J Cell Sci"},"pubYear":{"0":"2015"},"journalVolume":{"0":"128"},"issue":"","pageInfo":{"0":"1375-1385"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25972173"},"title":{"0":"Synaptic Function of Rab11Fip5: Selective Requirement for Hippocampal Long-Term Depression."},"authors":{"0":"Bacaj T, Ahmad M, Jurado S, Malenka RC, S\u00fcdhof TC."},"journalTitle":{"0":"J Neurosci"},"pubYear":{"0":"2015"},"journalVolume":{"0":"35"},"issue":"","pageInfo":{"0":"7460-7474"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25632160"},"title":{"0":"Myosin Va mediates BDNF-induced postendocytic recycling of full-length TrkB and its translocation into dendritic spines."},"authors":{"0":"Sui WH, Huang SH, Wang J, Chen Q, Liu T, Chen ZY."},"journalTitle":{"0":"J Cell Sci"},"pubYear":{"0":"2015"},"journalVolume":{"0":"128"},"issue":"","pageInfo":{"0":"1108-1122"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25686250"},"title":{"0":"Early steps in primary cilium assembly require EHD1\/EHD3-dependent ciliary vesicle formation."},"authors":{"0":"Lu Q, Insinna C, Ott C, Stauffer J, Pintado PA, Rahajeng J, Baxa U, Walia V, Cuenca A, Hwang YS, Daar IO, Lopes S, Lippincott-Schwartz J, Jackson PK, Caplan S, Westlake CJ."},"journalTitle":{"0":"Nat Cell Biol"},"pubYear":{"0":"2015"},"journalVolume":{"0":"17"},"issue":"","pageInfo":{"0":"228-240"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25904794"},"title":{"0":"Protein Interacting with C-Kinase 1 Deficiency Impairs Glutathione Synthesis and Increases Oxidative Stress via Reduction of Surface Excitatory Amino Acid Carrier 1."},"authors":{"0":"Wang YN, Zhou L, Li YH, Wang Z, Li YC, Zhang YW, Wang Y, Liu G, Shen Y."},"journalTitle":{"0":"J Neurosci"},"pubYear":{"0":"2015"},"journalVolume":{"0":"35"},"issue":"","pageInfo":{"0":"6429-6443"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"26041286"},"title":{"0":"Intracellular Transport of Vaccinia Virus in HeLa Cells Requires WASH-VPEF\/FAM21-Retromer Complexes and Recycling molecules Rab11 and Rab22."},"authors":{"0":"Hsiao JC, Chu LW, Lo YT, Lee SP, Chen TJ, Huang CY, Ping YH, Chang W."},"journalTitle":{"0":"J Virol"},"pubYear":{"0":"2015"},"journalVolume":"","issue":"","pageInfo":""},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25704914"},"title":{"0":"Mechanisms regulating cell membrane localization of the chemokine receptor CXCR4 in human hepatocarcinoma cells."},"authors":{"0":"Cepeda EB, Dediulia T, Fernando J, Bertran E, Egea G, Navarro E, Fabregat I."},"journalTitle":{"0":"Biochim Biophys Acta"},"pubYear":{"0":"2015"},"journalVolume":{"0":"1853"},"issue":"","pageInfo":{"0":"1205-1218"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"26021297"},"title":{"0":"The small GTPase Rab29 is a common regulator of immune synapse assembly and ciliogenesis."},"authors":{"0":"Onnis A, Finetti F, Patrussi L, Gottardo M, Cassioli C, Span\u00f2 S, Baldari CT."},"journalTitle":{"0":"Cell Death Differ"},"pubYear":{"0":"2015"},"journalVolume":"","issue":"","pageInfo":""},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"26004511"},"title":{"0":"Slitrk5 Mediates BDNF-Dependent TrkB Receptor Trafficking and Signaling."},"authors":{"0":"Song M, Giza J, Proenca CC, Jing D, Elliott M, Dincheva I, Shmelkov SV, Kim J, Schreiner R, Huang SH, Castr\u00e9n E, Prekeris R, Hempstead BL, Chao MV, Dictenberg JB, Rafii S, Chen ZY, Rodriguez-Boulan E, Lee FS."},"journalTitle":{"0":"Dev Cell"},"pubYear":{"0":"2015"},"journalVolume":{"0":"33"},"issue":"","pageInfo":{"0":"690-702"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25753037"},"title":{"0":"LTP-triggered cholesterol redistribution activates Cdc42 and drives AMPA receptor synaptic delivery."},"authors":{"0":"Brachet A, Norwood S, Brouwers JF, Palomer E, Helms JB, Dotti CG, Esteban JA."},"journalTitle":{"0":"J Cell Biol"},"pubYear":{"0":"2015"},"journalVolume":{"0":"208"},"issue":"","pageInfo":{"0":"791-806"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"26110570"},"title":{"0":"Predominant Rab-GTPase amplicons contributing to oral squamous cell carcinoma progression to metastasis."},"authors":{"0":"da Silva SD, Marchi FA, Xu B, Bijian K, Alobaid F, Mlynarek A, Rogatto SR, Hier M, Kowalski LP, Alaoui-Jamali MA."},"journalTitle":{"0":"Oncotarget"},"pubYear":{"0":"2015"},"journalVolume":"","issue":"","pageInfo":""},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"26067165"},"title":{"0":"Site-Specific Phosphorylation of VEGFR2 Is Mediated by Receptor Trafficking: Insights from a Computational Model."},"authors":{"0":"Clegg LW, Mac Gabhann F."},"journalTitle":{"0":"PLoS Comput Biol"},"pubYear":{"0":"2015"},"journalVolume":{"0":"11"},"issue":"","pageInfo":{"0":"e1004158"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25941134"},"title":{"0":"Mechanisms of apical-basal axis orientation and epithelial lumen positioning."},"authors":{"0":"Overeem AW, Bryant DM, van IJzendoorn SC."},"journalTitle":{"0":"Trends Cell Biol"},"pubYear":{"0":"2015"},"journalVolume":"","issue":"","pageInfo":""},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25394938"},"title":{"0":"The fungal pathogen Cryptococcus neoformans manipulates macrophage phagosome maturation."},"authors":{"0":"Smith LM, Dixon EF, May RC."},"journalTitle":{"0":"Cell Microbiol"},"pubYear":{"0":"2015"},"journalVolume":{"0":"17"},"issue":"","pageInfo":{"0":"702-713"}},{"hitCount":{"0":"3347"},"page":{"0":"1"},"pmid":{"0":"25800842"},"title":{"0":"3D time-lapse analysis of Rab11\/FIP5 complex: spatiotemporal dynamics during apical lumen formation."},"authors":{"0":"Mangan A, Prekeris R."},"journalTitle":{"0":"Methods Mol Biol"},"pubYear":{"0":"2015"},"journalVolume":{"0":"1298"},"issue":"","pageInfo":{"0":"181-186"}}]
最佳答案
因为标题实际上是一个Object
。
"title":{
"0":"Hypoxia upregulates Rab11-family interacting protein 4 through HIF-1\u03b1 to promote the metastasis of hepatocellular carcinoma."
}
如果你不能改变输出尝试这样访问:
json_obj[0].title["0"];
但如果标题来自您准备使用的 php 会更好。在这种情况下,我看不出有任何理由返回数组。
关于javascript - 如何访问放置在 javascript 对象中的对象的属性?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31279919/
我想做的是让 JTextPane 在 JPanel 中占用尽可能多的空间。对于我使用的 UpdateInfoPanel: public class UpdateInfoPanel extends JP
我在 JPanel 中有一个 JTextArea,我想将其与 JScrollPane 一起使用。我正在使用 GridBagLayout。当我运行它时,框架似乎为 JScrollPane 腾出了空间,但
我想在 xcode 中实现以下功能。 我有一个 View Controller 。在这个 UIViewController 中,我有一个 UITabBar。它们下面是一个 UIView。将 UITab
有谁知道Firebird 2.5有没有类似于SQL中“STUFF”函数的功能? 我有一个包含父用户记录的表,另一个表包含与父相关的子用户记录。我希望能够提取用户拥有的“ROLES”的逗号分隔字符串,而
我想使用 JSON 作为 mirth channel 的输入和输出,例如详细信息保存在数据库中或创建 HL7 消息。 简而言之,输入为 JSON 解析它并输出为任何格式。 最佳答案 var objec
通常我会使用 R 并执行 merge.by,但这个文件似乎太大了,部门中的任何一台计算机都无法处理它! (任何从事遗传学工作的人的附加信息)本质上,插补似乎删除了 snp ID 的 rs 数字,我只剩
我有一个以前可能被问过的问题,但我很难找到正确的描述。我希望有人能帮助我。 在下面的代码中,我设置了varprice,我想添加javascript变量accu_id以通过rails在我的数据库中查找记
我有一个简单的 SVG 文件,在 Firefox 中可以正常查看 - 它的一些包装文本使用 foreignObject 包含一些 HTML - 文本包装在 div 中:
所以我正在为学校编写一个 Ruby 程序,如果某个值是 1 或 3,则将 bool 值更改为 true,如果是 0 或 2,则更改为 false。由于我有 Java 背景,所以我认为这段代码应该有效:
我做了什么: 我在这些账户之间创建了 VPC 对等连接 互联网网关也连接到每个 VPC 还配置了路由表(以允许来自双方的流量) 情况1: 当这两个 VPC 在同一个账户中时,我成功测试了从另一个 La
我有一个名为 contacts 的表: user_id contact_id 10294 10295 10294 10293 10293 10294 102
我正在使用 Magento 中的新模板。为避免重复代码,我想为每个产品预览使用相同的子模板。 特别是我做了这样一个展示: $products = Mage::getModel('catalog/pro
“for”是否总是检查协议(protocol)中定义的每个函数中第一个参数的类型? 编辑(改写): 当协议(protocol)方法只有一个参数时,根据该单个参数的类型(直接或任意)找到实现。当协议(p
我想从我的 PHP 代码中调用 JavaScript 函数。我通过使用以下方法实现了这一点: echo ' drawChart($id); '; 这工作正常,但我想从我的 PHP 代码中获取数据,我使
这个问题已经有答案了: Event binding on dynamically created elements? (23 个回答) 已关闭 5 年前。 我有一个动态表单,我想在其中附加一些其他 h
我正在尝试找到一种解决方案,以在 componentDidMount 中的映射项上使用 setState。 我正在使用 GraphQL连同 Gatsby返回许多 data 项目,但要求在特定的 pat
我在 ScrollView 中有一个 View 。只要用户按住该 View ,我想每 80 毫秒调用一次方法。这是我已经实现的: final Runnable vibrate = new Runnab
我用 jni 开发了一个 android 应用程序。我在 GetStringUTFChars 的 dvmDecodeIndirectRef 中得到了一个 dvmabort。我只中止了一次。 为什么会这
当我到达我的 Activity 时,我调用 FragmentPagerAdapter 来处理我的不同选项卡。在我的一个选项卡中,我想显示一个 RecyclerView,但他从未出现过,有了断点,我看到
当我按下 Activity 中的按钮时,会弹出一个 DialogFragment。在对话框 fragment 中,有一个看起来像普通 ListView 的 RecyclerView。 我想要的行为是当
我是一名优秀的程序员,十分优秀!