Replies: 1 comment 1 reply
-
|
Hi! Not sure if related, but a while ago I opened up this issue, #856, regarding Javascript not executing. Just thought I would link in the case that they are related. H2O.ai team has put in a fix for my specific issue in the coming versions of Wave! Hope this helps |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi
I have a markup card that is loaded with a HTML that uses javascript and when using the app the javascript is not executed, can you explain me why.
this is my markupcard:
q.page['header'] = ui.markup_card(box=ui.boxes(ui.box('header')), title='', content=getHTMLHeader(q), )this is my HTML functions:
def getHTMLHeader(q: Q): return f'''<head> <link rel="stylesheet" href="{q.app.template_css}"> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous"> <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script> <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script> </head> <body> <header class="header""> <div id="logo"><img src="{q.app.image_path}" alt=""></div> <h1><a>UTopIA2.0</a></h1> </header> <section id="navigation"> <div class="topnav" > <ul class="tabs"> <li class="nav-link active"><a href="#Home">Home</a></li> <li><a class="nav-link" href="#H2o">H2O</a></li> <li><a class="nav-link" href="#DataKnowledge">DataKnowledge</a></li> <li><a class="nav-link" href="#Servicos">Serviços</a></li> <li><a class="nav-link" href="#Admin">Admin</a></li> <li><a class="nav-link"href="#Help">Help</a></li> </ul> </div> <script src="{q.app.Home_js}"></script> </section> </body>'''and the content of q.app.Home_js (external file):
`/* Code for changing active
link on clicking */
var btns =
$("#navigation .tabs .nav-link");
for (var i = 0; i < btns.length; i++) {
btns[i].addEventListener("click",
function () {
var current = document
.getElementsByClassName("active");
}
/* Code for changing active
link on Scrolling */
$(window).scroll(function () {
var distance = $(window).scrollTop();
$('.page-section').each(function (i) {
}).scroll();`
Beta Was this translation helpful? Give feedback.
All reactions