Answer the question
In order to leave comments, you need to log in
How to use Bootstrap and jQuery without using external source?
How to use Bootstrap and jQuery without using external source?
I'm trying to use a sidebar in a table. The code connects Bootstrap and jQuery by url.
// Подключаем Bootstrap
var sidebarHTML = '<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">';
// Подключаем jQuery
sidebarHTML += '<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>';
Answer the question
In order to leave comments, you need to log in
HTML Service: Best Practices Create tools.gs
on the server side
function include(filename) {
return HtmlService.createHtmlOutputFromFile(filename)
.getContent();
}
<style>
Тут код вашего BS
</style>
<script>
Тут код вашей JQ
</script>
<!DOCTYPE html>
<html>
<head>
<base target="_top">
<?!= include('bs'); ?>
</head>
<body>
<h1>Welcome</h1>
<p>Please enjoy this helpful script.</p>
<?!= include('jq'); ?>
</body>
</html>
function showSidebar() {
var htmlTemplate = HtmlService
.createTemplateFromFile('client');
SpreadsheetApp.getUi().showSidebar(htmlTemplate.evaluate()
.setTitle('Цвет текста в ячейке поменялся'));
}
Did so. Mistake
// Подключаем Bootstrap
var sidebarHTML = '<?!= include('bs'); ?>';
//var sidebarHTML = '<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css">';
// Подключаем jQuery
sidebarHTML += '<?!= include('jq'); ?>'
//sidebarHTML += '<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>';
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question