![](/img/trans.png)
[英]How to get the last folder name and file name from a path using JavaScript?
[英]how to Get data from different folder file and that html file name using javascript
$scope.Obj = {
Allcontent: []
};
var ContentName = [];
$scope.fileName = ["login", "info"];// html file names
var input = document.getElementById("Myinput");// search box id
var value = input.value.toUpperCase();
angular.forEach($scope.fileName, function(Value) {
$.get('file/'+Value+'.html', function(result) {
var input, filter, title, i;
var path = $(result).find('meta').content;
input = $(result).find('h1').innerHTML.toUpperCase();
title = $(result).find('title').innerHTML.toUpperCase();
$scope.Obj['Allcontent'].push({"Value":title, "Path":path});
$scope.Obj['Allcontent'].push({"Value":input, "Path":path});
ContentName.push(title);
ContentName.push(input);
ContentName= [ ...new Set(ContentName) ];// for remove duplicate values
$scope.getContentName= ContentName.filter(el => el.includes(value));
});
});
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.