我正从具有对象数组的json文件中检索数据,这些对象也包含嵌套对象数组。
以下是示例。
[
{
"systemId": "3jtc99bvzP",
"systemName": "HTML Basics",
"defect": [],
"searchKey": [
{
"searchkey": "Dhanasekar_Mohan",
"searchId": "129391f9",
"systemName": "HTML Basics",
"systemId": "3jtc99bvzP"
},
{
"searchkey": "Dhanasekar_Mohan",
"searchId": "129391f9",
"systemName": "HTML Basics",
"systemId": "3jtc99bvzP"
}
],
"otherDetails": [
{
"img": "/MasterPage/img/blog_post3.jpg",
"description": "<p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\">A beginning tag is generally a word surrounded by brackets. The closure tag is surrounded by the same brackets but with a forward slash right after the opening bracket.</p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\">For example, if you want to bold a portion of a sentence, then you would use <b> for the opening tag and </b> for the closing.</p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\">Let's say you want to bold the word \"Hello!\" in the sentence below. Then your HTML code would look like this:</p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\"><em><b>Hello!</b></em><span> </span>My name is Carla.</p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\">The output would be: </p><p align=\"center\" style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;text-align:center;background:white;\"><strong>Hello!</strong><span> </span>My name is Carla.</p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\">Only the word \"Hello!\" is bolded because the tags surround that word. If you wanted to bold the entire sentence, then you would have put the closure tag, </b>, after the word \"Carla\". Be sure to always include your closing tag because if you forget, your entire page will be affected by the tag.</p><p style=\"margin-bottom:15pt;background:white;\"><a name=\"basic\"><strong><span style=\"text-decoration:underline;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Basic Text & Font Tags</span></span></strong></a><strong></strong></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">New Paragraph:</span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"> <p> Starts a new paragraph and creates a blank line between your new paragraph and the one above it. </span></p><p style=\"margin-bottom:21pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">The closing tag is </p>, but is not mandatory.</span></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Line Break:</span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"> <br> This will break your text to the next line. Two <br> tags is equivalent to one <p> tag. There's no closing tag needed for this one.</span></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Bold:</span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"> <b> Closing tag is </b></span></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Underline:</span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"> <u> Closing tag is </u></span></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Italics:</span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"> <i> Closing tag is </i></span></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Centering text:</span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"> <center> Closing tag is </center></span></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Left aligning text: </span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"><p align=\"left\"> Just use </p> for the closing tag</span></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Right aligning text: </span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"><p align=\"right\"> Just use </p> for the closing tag</span></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Change text color: </span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"><font color=\"red\"> The ending for any font tag is </font> </span></p><p style=\"margin-bottom:21pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">If you want more colors, you can also use my </span><a href=\"http://www.2createawebsite.com/build/html.html#colors\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:windowtext;\">hex color code tools</span></a><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">.</span></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Changing font face:</span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"> <font face=\"Arial\"></span></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Change font size: </span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"><font size=\"3\"> (choose between 1 and 7)</span></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Blinking Text: </span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"><blink> </blink> (only works in Netscape)</span></p><p style=\"margin-bottom:21pt;background:white;\"><strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Scrolling Text: </span></strong><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\"><marquee> </marquee> (only works in Internet Explorer)</span></p><h2 style=\"margin-top:0in;margin-right:0in;margin-bottom:15.0pt;margin-left:0in;background:white;\"><span style=\"font-size:12.0pt;\">Basic Structure of an HTML Page</span></h2><p style=\"margin-bottom:21pt;background:white;\"><span style=\"font-size:12pt;font-family:'Times New Roman', serif;background-image:initial;background-attachment:initial;background-size:initial;background-origin:initial;background-clip:initial;background-position:initial;background-repeat:initial;\">Here you will see a sample HTML page with the basic structure.</span></p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\"><html></p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\"><head></p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\"><title>Title that is displayed at the top of your web browser and also used as the title by many search engines</title></p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\"><meta name=\"description\" content=\"10-15 word description of your site read by some search engines\"></p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\"><meta name=\"keywords\" content=\"main keywords of your site separated by commas. Read by some search engines\"></p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\"></head></p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\"><body></p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\"><p align=\"left\"></p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\">This is my new web page. I hope you like it. Please come back and visit again. If you need help creating your web site visit <a href=\"http://www.2createawebsite.com\">2 Create a Website.com</a>.</p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\"></p></p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\"></body></p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\"></html></p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\">The <html> tag just tells the browser where the HTML starts. It is not necessary to include this tag to get your page to show.</p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\">The <title> tells your browser the title of the page and you<span style=\"font-family:'Tahoma',sans-serif;\">�</span>ll see this text at the very top of your web browser. This is also used by most search engines when indexing your page. Whatever text you have here will be title of your site when displayed in the search engines.</p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\">The <meta name> information is also somewhat useful for some search engines. They may use whatever is in your \"description\" tag to describe your site. Others may randomly take an excerpt of the <body> of your page for a description of your site. The keyword tag may also be helpful with your ranking in some engines. Insert 3 or 4 of your main keywords or keyword phrases separated by commas here.</p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\">A few years ago, the <meta name> information was quite crucial in getting a top listing with the search engines. However, things have changed drastically with the explosion of so many new sites and the fact that many people abused it. I would still recommend using these tags but don<span style=\"font-family:'Tahoma',sans-serif;\">�</span>t expect to get a top ranking because of them.</p><p style=\"margin-top:0in;margin-right:0in;margin-bottom:21.0pt;margin-left:0in;background:white;\">The body of your site should be included inside the <body> tags.</p>",
"url": ""
}
],
"noofview": "0",
"sybcategory": null,
"lastmodifieddate": "6-5-2015",
"lastmodifiedby": "Dhanasekar_Mohan"
},
{
"systemId": "fTxqPf8dqs",
"systemName": "JQuery",
"defect": [],
"searchKey": [
{
"searchkey": "Dhanasekar_Mohan",
"searchId": "327f8fca",
"systemName": "JQuery",
"systemId": "fTxqPf8dqs"
},
{
"searchkey": "Dhanasekar_Mohan",
"searchId": "327f8fca",
"systemName": "JQuery",
"systemId": "fTxqPf8dqs"
}
],
"otherDetails": [
{
"img": "/MasterPage/img/blog_post3.jpg",
"description": "<p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"color:#333333;font-family:'Times New Roman', serif;font-size:12pt;line-height:16.05pt;\">The purpose of jQuery is to make it much easier to use JavaScript on your website.</span><br /></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">jQuery takes a lot of common tasks that require many lines of JavaScript code to accomplish, and wraps them into methods that you can call with a single line of code.</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">jQuery also simplifies a lot of the complicated things from JavaScript, like AJAX calls and DOM manipulation.</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">The jQuery library contains the following features:</span></p><ul type=\"disc\"><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">HTML/DOM manipulation</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">CSS manipulation</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">HTML event methods</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Effects and animations</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">AJAX</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Utilities</span></li></ul><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">There are lots of other JavaScript frameworks out there, but jQuery seems to be the most popular, and also the most extendable.</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">Many of the biggest companies on the Web use jQuery, such as:</span></p><ul type=\"disc\"><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Google</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Microsoft</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">IBM</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Netflix</span></li></ul><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">There are several ways to start using jQuery on your web site. You can:</span></p><ul type=\"disc\"><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Download the jQuery library from jQuery.com</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">Include jQuery from a CDN, like Google</span></li></ul><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">jQuery has several methods for CSS manipulation. We will look at the following methods:</span></p><ul type=\"disc\"><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">addClass() - Adds one or more classes to the selected elements</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">removeClass() - Removes one or more classes from the selected elements</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">toggleClass() - Toggles between adding/removing classes from the selected elements</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">css() - Sets or returns the style attribute</span></li></ul><ul><li><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">AJAX = Asynchronous JavaScript and XML.</span></li><li><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">In short; AJAX is about loading data in the background and display it on the webpage, without reloading the whole page.</span></li><li><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">Examples of applications using AJAX: Gmail, Google Maps, Youtube, and Facebook tabs.</span></li><li><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">jQuery provides several methods for AJAX functionality.</span></li><li><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">With the jQuery AJAX methods, you can request text, HTML, XML, or JSON from a remote server using both HTTP Get and HTTP Post - And you can load the external data directly into the selected HTML elements of your web page!</span></li></ul><p style=\"text-align:justify;\"><span style=\"font-size:12.0pt;line-height:107%;font-family:'Times New Roman',serif;\"> </span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">The jQuery syntax is tailor made for <strong>selecting</strong> HTML elements and performing some <strong>action</strong> on the element(s).</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">Basic syntax is: <strong>$(<em>selector</em>).<em>action</em>()</strong></span></p><ul type=\"disc\"><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">A $ sign to define/access jQuery</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">A (<em>selector</em>) to \"query (or find)\" HTML elements</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">A jQuery <em>action</em>() to be performed on the element(s)</span></li></ul><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">Examples:</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">$(this).hide() - hides the current element.</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">$(\"p\").hide() - hides all <p> elements.</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">$(\".test\").hide() - hides all elements with class=\"test\".</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">$(\"#test\").hide() - hides the element with id=\"test\".</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">jQuery selectors allow you to select and manipulate HTML element(s).</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">jQuery selectors are used to \"find\" (or select) HTML elements based on their id, classes, types, attributes, values of attributes and much more. It's based on the existing </span><a href=\"http://www.w3schools.com/cssref/css_selectors.asp\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">CSS Selectors</span></a><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">, and in addition, it has some own custom selectors.</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">All selectors in jQuery start with the dollar sign and parentheses: $().</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">All the different visitor's actions that a web page can respond to are called events.</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">An event represents the precise moment when something happens.</span></p><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">Examples:</span></p><ul type=\"disc\"><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">moving a mouse over an element</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">selecting a radio button</span></li><li style=\"color:#333333;text-align:justify;line-height:16.05pt;tab-stops:list .5in;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;\">clicking on an element</span></li></ul><p style=\"margin-bottom:7.5pt;text-align:justify;line-height:16.05pt;background:white;\"><span style=\"font-size:12.0pt;font-family:'Times New Roman',serif;color:#333333;\">The term <strong>\"fires\"</strong> is often used with events. Example: \"The keypress event fires the moment you press a key\".</span></p>",
"url": ""
}
],
"noofview": "0",
"sybcategory": null,
"lastmodifieddate": "6-5-2015",
"lastmodifiedby": "Dhanasekar_Mohan"
}]
这里有两个基础数组中的对象,它本身包含两个对象数组。
我试图用
找到它的长度var l = $scope.compData.length;
在这里,我应该给那些没有工作的人。
我已将数据存储在$ scope.compData
中这是angularJs代码
.controller('gridListDemoCtrl', function ($scope, Bsmart) {
$scope.compData = {};
Bsmart.get().then(function (msg) {
$scope.compData = msg.data;
});
days();
function days() {
var currentDate = new Date();
var cd = currentDate.getDate();
var l;
l = $scope.compData.length;
for(var i=0;i<l;i++)
{
$scope.compData[i].lastmodifieddate = l;
}
}
});
任何帮助都会很明显。
答案 0 :(得分:0)
这里:
Bsmart.get().then(function (msg) {
$scope.compData = msg.data;
});
您作为参数提供的功能将异步执行。但是,在你的主线程中,你立即调用days();
,它在$scope.compData
上执行操作,这仍然是一个空对象(当你初始化它时)。
您应该在回调函数中调用days()
。
Bsmart.get().then(function (msg) {
$scope.compData = msg.data;
days();
});