Chrome Extension Append Input To Url.
I'm currently creating a Chrome Extension that has a popup.html and in that pop up is 2 things. An input field and Submit button. The Input field takes a EXTN number from a user a
Solution 1:
You can't use inline JS in Chrome extension (the onclick="goToPage();"
in the input element is considered inline Javascript) . You have to put all your Javascript code in a separate file.
You will need to use chrome.tabs API to open a new tab. For example:
popup.html
<inputtype="text"id="page" /><buttonid="submit">Submit</button><scriptsrc="popup.js"></script>
popup.js
document.getElementById('submit').onclick = function(){
var page = document.getElementById('page').value;
chrome.tabs.create({url:'http://name.com/' + page});
}
Post a Comment for "Chrome Extension Append Input To Url."