init
This commit is contained in:
16
js/popup.js
16
js/popup.js
@@ -1,12 +1,22 @@
|
||||
$(function () {
|
||||
alert("加载中")
|
||||
chrome.tabs.query({ active: true, lastFocusedWindow: true }, tabs => {
|
||||
let url = tabs[0].url;
|
||||
console.log(tabs[0]);
|
||||
$('#total').val(url);
|
||||
let favIconUrl = tabs[0].favIconUrl;
|
||||
let title = tabs[0].title;
|
||||
$('#url').val(url);
|
||||
$('#title').val(title);
|
||||
$('#icon').val(favIconUrl);
|
||||
$("#icon-img").attr("src",favIconUrl);
|
||||
// use `url` here inside the callback because it's asynchronous!
|
||||
})
|
||||
})
|
||||
$("#sumbit").keyup(function(){
|
||||
txt=$("input").val();
|
||||
$.post("demo_ajax_gethint.asp",{suggest:txt},function(result){
|
||||
$("span").html(result);
|
||||
});
|
||||
});
|
||||
|
||||
// $(function(){
|
||||
// chrome.tabs.query({active: true, lastFocusedWindow: true}, tabs => {
|
||||
// let url = tabs[0].url;
|
||||
|
||||
Reference in New Issue
Block a user