function operateSyncLink(syncLink) {
if (syncLink == "undefined") {
return;
}
// 是应用
if (syncLink.indexOf("com.") == 0) {
STBAppManager.startAppByName(syncLink);
} else {
// 链接中有window.location.href参数
if (syncLink.indexOf("window.location.href") >= 0) {
var newSyncLink = syncLink.substring(0, syncLink
.indexOf("window.location.href"))
+ encodeURIComponent(window.location.href)
+ syncLink.substring(syncLink
.indexOf("window.location.href")
+ "window.location.href".length);
window.location = getRootPath_web() + "/" + newSyncLink;
return;
}
window.location = getRootPath_web() + "/" + syncLink;
}
}
function getSyncImage(obj) {
return getRootPath_web() + "/" + obj.imgSrc;
}
//启动盒子设置
function startSetting() {
STBAppManager.startAppByName('com.skyworthdigital.settings');
STBAppManager.startAppByName('com.android.ovt.settings');
STBAppManager.startAppByName('com.android.smart.terminal.settings');
STBAppManager.startAppByName('com.android.settings');
}
function getUrlParam(name) {
var query = window.location.search; //获取URL"?"后面的字符串
if (query.length == 0) {
return "";
} else {
var iLen = param.length;
var iStart = query.indexOf(param);
if (iStart == -1) //判断是否有那个需要查询值的传递参数
return ""; //没有就返回一个空值
iStart += iLen + 1;
var iEnd = query.indexOf("&", iStart); //判断是不是带有多个参数 &为多个参数的连接符号
if (iEnd == -1) {
return query.substring(iStart);
}
return query.substring(iStart, iEnd);
}
}
function redirect(url) {
if (url.indexOf("http") != 0) {
url = getRootPath_web() + url;
}
window.location.href = url;
}
function isEmpty(param) {
if (param == "" || param == "undefined" || param == undefined || param == null) {
return true;
} else {
return false;
}
}
添加回答
举报
0/150
提交
取消