Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function readSearchLs() {
var indexSearchHs = cs.get('indexSearchHs');
var $SearchLsWrap = $('.indexSearchList');
var dtBool = true;
if (indexSearchHs == null) {
indexSearchHs = [];
} else {
indexSearchHs = indexSearchHs.split(',');
}
if (indexSearchHs.length > 0) {
$SearchLsWrap.children('dd').remove();
$.each(indexSearchHs, function (i, v) {
$('<dd><a>' + v + '</a><span class="add"></span></dd>').prependTo($SearchLsWrap);
});
$SearchLsWrap.show().find('dt').show().children('.clear').show();
} else {
dtBool = false;
$SearchLsWrap.hide();
}
}
// 保存最新历史记录方法
var showPoster = function (key, val) {
var ggArr = {};
var string = '';
$.each(adStore, function (index, value) {
string = string + '|' + value;
});
ggArr['ad_key'] = string.substr(1);
val !== undefined ? ggArr[key] = val : 0;
ggArr['charset'] = 'utf8';
mobileAd.getAd(ggArr);
// mobileAd.getParseWordInp();
};
// build说明: 广告组件,在页面展示,需要尽快加载
success: function (data) {
var length = data.list.length;
var con = '<div class="cost-list"><ul>';
$.each(data.list, function (i, t) {
if (i >= 5) {
con += '<li class="none">\
<a href="' + t.href + '" class="dis-box">\
<p class="box-flex-1 cost-name">' + t.store_name + '</p><p class="pr10">\
<b class="cost-num"><em>¥</em>' + t.shop_price + '</b>\
<span class="cost-icon"><b></b></span></p></a></li>';
}
else {
con += '<li><a href="' + t.href + '" class="dis-box">\
<p class="box-flex-1 cost-name">' + t.store_name + '</p><p class="pr10">\
<b class="cost-num"><em>¥</em>' + t.shop_price + '</b>\
<span class="cost-icon"><b></b></span></p></a></li>';
}
});
con += '</ul>';
if (length > 5) {</div>
$.each(data, function (index, val) {
var quote = val.quote;
var digits = 2;
var time = quote.q59;
if (typeof (time) !== 'undefined') {
if (new Date(time).getTime() > newTime) {
newTime = time;
}
}
digits = quote.digits;
if (isNaN(digits)) {
digits = 2;
}
index += 1;
$.each(idsArry, function (idsIndex, val) {
var textColor = undefined;
var valueStr = undefined;
if (colorSet[val]) {
textColor = getColor(val, 'q2', quote);
} else if (specalColorMap[val] !== undefined) {
textColor = getColor('q63', 'q2', quote);
}
if (colorSet[val]) {
valueStr = format(quote[val], digits);
} else if (val === 'q70') {
valueStr = format(quote[val], digits);
} else if (val === 'q80') {
valueStr = format(quote[val], 2) + '%';
} else {
valueStr = quote[val];
success: function (area) {
$.each(area, function (i, item) {
$(element).find('#dd_car').append($('<optgroup></optgroup>').attr('label', item.name));
$.each(item.data, function (i, data) {
$(element).find('#dd_car').append($('<option></option>').val(data.id).html(data.name));
});
});
}
});
$.each(area, function (i, item) {
$(element).find('#dd_series').append($('<optgroup></optgroup>').attr('label', item.name));
$.each(item.data, function (i, data) {
$(element).find('#dd_series').append($('<option></option>').val(data.id).html(data.name));
});
});
}
htmlNews += [
'<div class="mip-news-recommend-item">',
'<a data-click="\''" data-url="' + item.url
+ '" href="' + href + '" class="mip-news-recommend-href">',
'<div class="mip-news-recommend-title">' + item.title + '</div>',
'<div class="mip-news-recommend-info">',
'<span>' + formatTime(item.time) + '</span>',
'<span class="mip-news-recommend-provider">' + item.provider + '</span>',
'</div>',
'</a>',
'</div>'
].join('');
});
$.each(data.hot_card, function (i, item) {
var dataClick = self.handleData(item, i, 'hotpoint');
var href = isIframe ? 'javascript:void(0);' : item.url;
if (i % 2 === 0) {
htmlHots += '<div class="mip-news-recommend-row">';
}
htmlHots += [
'<div class="mip-news-recommend-hot-item">',
'<a data-click="\''" data-url="' + item.url
+ '" href="' + href + '" class="mip-news-recommend-hot-href">',
item.query,
'</a>',
'</div>'
].join('');
</div>
loadJs(elem, 'https://a.xywy.com/mobile_v3.js', function () {
var ggArr = {};
var string = '';
$.each(adStore, function (index, value) {
string = string + '|' + value;
});
ggArr['ad_key'] = string.substr(1);
ggArr['department'] = department;
ggArr['charset'] = 'utf8';
mobileAd.getAd(ggArr);
});
}
async visitNode($el) {
if ($el.length === 0) return;
if ($el.hasClass('ios-overlay')) return;
const el = $el[0];
debug('Visiting Node', el);
const tag = el.tagName.toLowerCase();
if (IGNORED_TAG_TYPES.indexOf(tag) >= 0) return null;
const $clone = $(document.createElement(tag));
$.each($el[0].attributes, (index, attribute) => {
if (attribute.name === 'class') {
return;
} else if (attribute.name === 'src' || attribute.name === 'href') {
$clone.attr(attribute.name, resolveURL(attribute.value))
} else {
$clone.attr(attribute.name, attribute.value);
}
});
if (tag === 'img') {
$clone.attr('src', await safeDownloadImage($clone.attr('src')));
}
const style = window.getComputedStyle(el);
const decl = {};
for (let i = style.length; i--;) {
const prop = style[i];
let val = style.getPropertyValue(prop);
success: function (data, textStatus, jqxhr) {
$SearchLsWrap.show().children('dd').remove();
var sw = SearchInput.val();
var lw = $SearchLsWrap;
if (data.HotWords.length > 0) {
$.each(data.HotWords, function (i, v) {
v.Word = v.Word.replace(sw, '<span class="gl">' + sw + '</span>');
$('<dd><a>' + v.Word + '</a><span class="add"></span></dd>').prependTo(lw);
});
$SearchLsWrap.find('.clear').hide();
} else {
$SearchLsWrap.find('dt').hide();
}
}
});