Python Daily
2.57K subscribers
1.48K photos
53 videos
2 files
38.9K links
Daily Python News
Question, Tips and Tricks, Best Practices on Python Programming Language
Find more reddit channels over at @r_channels
Download Telegram
how do i pass a parameter to js function in flask ?

Hello all, i am a python beginner trying to make a portfolio website using flask to show some visualization i created using power bi .

i have followed the MSFT example to apply embedded 1 vis following the example but i am struggling to embedded multiple vis as i not yet able to find a way to pass a variable to to js so that it can embedded the other vis .

The place "VAR" is originally coded as 0 in the MSFT example it make the page only show the first report i have in the list of report id .

I need to assign a value for var (like 0 , 1,2 ,3 for 1st 2nd , 3rd , 4th report) for different "section tag" to extract the corresponding report but i don't know how .

Thank you

mypage.html

`{% extends "template.html" %}{% block title %}mypage{% endblock %}{% block content %}<section id="report-container" class="embed-container col-lg-offset-4 col-lg-7 col-md-offset-5 col-md-7 col-sm-offset-5 col-sm-7 mt-5"></section>{% endblock %}`

`{% block footer %}<br>{% endblock %}`

&#x200B;

index.js inside static (edited to include the whole js function which include the .ajax method

`$(function () {`
`var reportContainer = $("#report-container").get(0);`


`$.ajax({`
`type: "GET",`
`url: "/getembedinfo",`
`dataType:

/r/flask
https://redd.it/108jcja