Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
blumi78
Helper I
Helper I

accessing window.jQuery / window.$

Why does PowerBI inserts this code segment to all Custom Visuals?

//de-reference powerbi loaded modules
var $, jQuery, _;
window.jQuery = window.$ = undefined;
window._ = undefined;

And why are these variables still functional using the F12 tools in the browser?

> $("body")[0]
<body class=​"visual-sandbox">​…​</body>​

Wouldn't it be much more convenient to be able to use these already loaded libraries in the custom visuals instead of reload them a second time?

1 ACCEPTED SOLUTION
v-viig
Community Champion
Community Champion

Power BI inserts this code to protect integrated jQuery from being replacented by custom visual's version.

This code isolates PBI libraries from custom visual ones.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

[email protected]

View solution in original post

1 REPLY 1
v-viig
Community Champion
Community Champion

Power BI inserts this code to protect integrated jQuery from being replacented by custom visual's version.

This code isolates PBI libraries from custom visual ones.

 

Ignat Vilesov,

Software Engineer

 

Microsoft Power BI Custom Visuals

[email protected]

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.