【发布时间】:2019-05-22 23:03:28
【问题描述】:
在我的应用程序中,我正在尝试使用 InAppBrowser 的 executeScript 方法执行一些脚本。记住我使用的是 Ionic Framework v2,这是我的代码:
browser.executeScript({
code: `
$(".rodape.geral table tbody tr:nth-child(2) td:nth-child(1) div:nth-child(1)").css("min-width","auto");
$(".rodape.geral table tbody tr:nth-child(2) td:nth-child(1) div:nth-child(1) div:nth-child(1)").css("width","auto");
$(".rodape.geral table tbody tr:nth-child(1) td:nth-child(2) table:nth-child(1)").attr("align","center");
`
}).then((e)=>{ console.log('JS adicionado.'); }).catch((e)=>{ console.log('Erro ao adicionar JS. '+e); });
为什么代码不工作并且不返回回调?谢谢。
【问题讨论】:
标签: cordova angular ionic-framework inappbrowser