google visualization google.load weirdness in Microsoft Edge - javascript

I am loading Google Visualization (for the core chart module) and am having issues with Microsoft Edge 20.1040.16384.0.
Here is a pared down version of the page which does nothing other than load the module:
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1.0', {'packages':['corechart']});
</script>
</head>
<body>
</body>
</html>
I am getting "Unexpected end tag." on the console reported on line 7 (the close tag on the block that is running google.load
Does anyone have any clue what is going on here?
P.S. The non-pared down version of my page (not shown here) is working fine in Chrome, but there are some issues in Firefox (though no error on the console)... so I am wondering if the Firefox issue might be connected to this. But I figure I can solve this issue and then try to figure out what is happening with Firefox.

Related

Python Eel - WebSocket connection to 'wss://cable.coingecko.com/cable' failed:

I have hard time in solving this problem when using Eel. I've used the free CoinGeckoAPI to display widgets in my page (using this template). Everything seemed fine until I checked the console of chrome devtools and found out these errors:
It seems that the error comes from this line in my index.html file (which is needed to correctly retrieve data from Coin Gecko):
<script src="https://widgets.coingecko.com/coingecko-coin-price-static-headline-widget.js"></script>
I've read many discussions about this bug, but none solve my issue. I also increased the shutdown_delay as a temporary fix just to prevent the webpage to be killed when refreshed fast enough (which also opened another problem to me). Any idea would be appreciated.
My app.py file (reduced):
import eel
#launch the webpage
try:
x = eel.start('index.html', mode='chrome', host='localhost', port=8080, cmdline_args=['--start-maximized'], shutdown_delay=2)
except OSError:
pass
index.html (very reduced):
<!DOCTYPE html>
<html lang="en">
<head>
<!-- to enable Eel framework-->
<script type="text/javascript" src="/eel.js"></script>
<!-- CoinGeckoAPI widget-->
<script src="https://widgets.coingecko.com/coingecko-coin-price-static-headline-widget.js"></script>
</head>
<body>
...
<coingecko-coin-price-static-headline-widget coin-ids="bitcoin" currency="php" locale="en"></coingecko-coin-price-static-headline-widget>
</body>
</html>

Local version of ReactJS not working on IE11, Edge, but remote version works

UPDATE: It turns out this isn't just occurring for local ReactJS scripts, but also for any other local external scripts used on the webpage.
This issue only occurs in Internet Explorer 11 and Edge as far as I know. I'm not sure if it occurs in previous versions of Internet Explorer.
The following code is in the file called index.html
<!DOCTYPE html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<link rel="stylesheet" type="text/css" href="./css/style.css">
</head>
<body>
<header><div id="header"></div></header>
<div id="scroller"></div>
<script type="text/javascript" src="./js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="./js/react.production.min.js"></script>
<script type="text/javascript" src="./js/react-dom.production.min.js">
</script>
<script type="text/javascript" src="./js/components/scroller.js"></script>
<script type="text/javascript" src="./js/widgets/header.js"></script>
</body>
</html>
What happens is if I attempt to use a local version of React, I get the error
'React' is undefined
However, if I use a remote version of both copies of React it works fine. The same occurs with JQuery when I switch back to the remote version of React while trying to use the local version of JQuery. One solution here I tried was to make sure the files were using the same encoding for the files. I think I was able to make sure they all had the same encoding. However, this did not solve the issue.
What approaches can I go about solving this issue?

Visual Studio 2013 IIS web site - problems with JS files

I am fighting this problem for almost a week. After googleing it a lot I decide to put here exactly what is my problem to see if someone can provide some light.
I am developing a website application using google chart. I am developing it with Visual Studio 2013 in ASP .NET. The application is published in IIS 8.5. The weird thing is that it was working fine until last week when I had do perform a server restart. After restarting it the application seems to be no able to load the JS API (not just google chart but any JS, including JQuery).
If I copy a google chart example (plain html with JS inside it) and open in Chrome it works so the javascript api is loading. The problem happen just when I try to run it from inside VS Studio (the erro message is [0x800a1391 - JavaScript runtime error: 'google' is undefined] or try to publish it.
Could it be some kind of network policie blocking it? How can I check it?
Here is the head of the default.aspx file
<head runat="server">
<title></title>
<style type="text/css">
.auto-style1 {
font-size: xx-large;
}
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="http://www.gstatic.com/charts/loader.js">
google.load('visualization', '1', { packages: ['corechart', 'bar', 'table', 'controls']});
</script>
<script src="GraphsAndTables.js"></script>
<script>google.setOnLoadCallback(DrawAll);</script>
As you can see the src are correct (I double check it and it loads in plain htlm).
I change the position of google.load() but it still giving the same erro.
You are using old library loader code you need to update your loader code or load both the old library loader and the new library loader.
Limitations: For Geochart and Map Chart, you must load both the old library loader
and the new library loader.
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
Your code should look like below
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>// Old Library Loader
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load('visualization', '1', { packages: ['corechart', 'bar', 'table', 'controls'] });
</script>
Check Google documntation to Update Library Loader Code

External JavaScript Files will not execute in IE9

The following is a snippit from my a little web page I'm putting together.
<script type="text/javascript" src="head.js">
</script>
<title>CPST 3410-85 Class Template</title>
</head>
<body onload="outputToDiv();">
The head.js file referenced in the script tag is below:
function outputToDiv() {
alert("JavaScript is working!");
}
In Chrome and in Firefox the alert is displayed indicating the JavaScript is working. In IE9 it is not. Furtermore I can't get ANY external script to run in IE9, regardless of the content. I have used custom security settings and lowered in a granular way every security setting to its lowest level, and gone into advanced settings and enabled literally everything I could find.
It should be noted that I am opening this from a local folder. All files are in the same folder, and again I stress that this works in firefox and chrome.
In IE9 I have enabled debugging and I get the error below:
Webpage error details
Message: Invalid character
Line: 1
Char: 1
Code: 0
URI: file:///E:/My%20Documents/My%20Web%20Sites/CPST341085/head.js
Of course it then tells me that "outputToDiv()" is undefined.
I am at a total loss here.
I got this behavior when I had:
<script type="text/javascript" src="jquery-1.7.1.js" />
However, this fixed it:
<script type="text/javascript" src="jquery-1.7.1.js"></script>
Go figure...
David

IE7 run only inline scripts... and not seems to include src scripts

my website is working in chrome, firefox and IE8. But when it comes to IE7 it doesnt work.
Only the inline scripts are working, and the included ones, are not.
what cause the problem? thank you!
I tried following code:
<html>
<head>
<script src="http://www.domain.com/scripts/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function()
{
alert("It works");
});
</script>
</head>
<body></body>
</html>
and it did work. A couple of reasons can be responsible for your problem:
The spaces in your URL
Some security options from your browser
Some security options from your network (content blocker). Have you tried to load the javascript file directly (paste the URL into adressbar)?
etc.

Categories

Resources