Invalid regular expression SyntaxError in Browser Console trying to load Embedded Content

If you try to load a Dashboard via an embedded content link from a HTML or JSP page, you may run into an issue where the content simply doesn't load. 

There can be several causes of this, but if you open up the (F12) Browser Console, in this particular scnario, you'll see an error like this:

Here's a simple example of an HTML page you should be able to use to load an embedded Dashboard (assuming you have a Guest Role setup and enabled):

<html>
<head>
    <title>Yellowfin</title>
</head>
<body>
<h1>Dashboard</h1>
<script type="text/javascript" src="http://localhost:8080/JsAPI/v3?dashUUID=12a1d00c-8391-48aa-9fbc-7b4779ac946c&width=1000&height=800"></script>
</body>
</html>

If you try to load this as-is, you will only see the H1 Dashboard header on the top of the screen.

This indicates an encoding error. To resolve this simply add a: 

<meta charset="utf-8"/>

tag to the <head> section.

Updated example:

<html>
<head>
    <title>Yellowfin</title>
    <meta charset="utf-8"/>
</head>
<body> 
<h1>Dashboard</h1> 
<script type="text/javascript" src="http://localhost:8080/JsAPI/v3?dashUUID=12a1d00c-8391-48aa-9fbc-7b4779ac946c&width=1000&height=800"></script> 
</body> 
</html>

The content will now load!

Is article helpful?