This code works well in web2py (parent and iframe) but only in parent page on py4web.
<html>
<style type="text/css">
ul ::-moz-focus-inner {
border: 0;
}
ul:active, ul:hover {
outline: none
}
ul {
outline: none;
}
ul :focus {
outline: none;
}
ul li{
width: auto;/*150px !important;*/
font-size: 0.7em;
font-weight: 600;
padding: 7px 7px 7px;
margin-top: 7px;
margin-bottom: 7px;
margin-right: 7px;
margin-left: 7px;
text-align: center;
display: inline-block;
cursor: pointer;
border:#D9383B solid 1px;
border-radius: 15px;
background-color: #D9383B;
color: white;/*#38D9D6;*/
}
ul {
margin-top: 7px !important;
/*margin-left: 35px;*/
display: none;
border: none;
height: 30px !important;
width: auto;
background-color: transparent;
cursor: pointer;
}
.test_wrapper {
height: 100px;
overflow-x: scroll;
overflow-y: hidden;
width: auto;/*96vw;*/
background-color: white;
}
</style>
<body>
<h1>Demo: JavaScript Variables </h1>
<div class="test_wrapper">
<div class="test_row">
<ul id="tesla"></ul>
</div>
</div>
<script type="text/javascript">
var tasks = ['error', 'referrals', 'advertise', 'tesla',]
if (tasks[3] == 'tesla' && Array.isArray(tasks)) {
alert('cool');
var link_tesla = "
https://www.tesla.com"
var a = document.createElement("a_err");
var ulist = document.getElementById("tesla");
var newItem = document.createElement("li");
a.textContent = "Read ModelX Here";
newItem.appendChild(a);
ulist.appendChild(newItem);
$("a_err").on("click", function() {
window.open(link_tesla, "_blank", "toolbar=yes,scrollbars=yes,resizable=yes,top=500,left=500,width=500,height=600");
});
}
</script>
</body>
</html>