How do I locate the discode widget bot? - discord

When I run it on my local server, the widget bot comes out well. However, after distribution, the location is set as shown in the picture below.
What's the problem?
enter image description here
This is my code
<script
src="https://cdn.jsdelivr.net/npm/#widgetbot/crate#3"
async="true"
defer="true"
type="text/javascript"
>
new Crate({
server: '1066208369901322371',
channel: '1067308918826598501',
location: ['bottom', 'right']
})
</script>
Is there a problem with the environment variable you are deploying?

Related

Data file location relative to html when running Azure Maps tutorials locally - atlas.io.read()

Trying to determine how to revise the atlas.ioread() function from the Azure Maps tutorial below to read the data locally on my windows machine.
atlas.io.read(window.location.origin + '/Common/data/Gpx/Route66Attractions.xml')
Does the 'window.location.origins +' work with local files?
I have nested the .xml file similarly to the above string, relative to the html file, however, it does reading the file when the map is launched.
Azure Maps Tutorial:
https://github.com/Azure-Samples/AzureMapsCodeSamples/blob/master/AzureMapsCodeSamples/Spatial%20IO%20Module/Load%20spatial%20data%20(simple).html
That function won't be able to access local files directly as the URL must be a http or https URL. There are a couple of approaches you can take.
If you plan to host the file later, you can host it locally on localhost and then have a URL pointing to it.
If you want to access local files, you will first need to load the file into your app using the file input tag and the FileReader class. Once you have the raw file data (text), you can pass that into the atlas.io.read function and it will process if for you. Here is a simple example:
<!DOCTYPE html>
<html>
<head>
<title>Read Text File</title>
<!-- Add references to the Azure Maps Map control JavaScript and CSS files. -->
<link rel="stylesheet" href="https://atlas.microsoft.com/sdk/javascript/mapcontrol/2/atlas.min.css" type="text/css" />
<script src="https://atlas.microsoft.com/sdk/javascript/mapcontrol/2/atlas.min.js"></script>
<!-- Add reference to the Azure Maps Spatial IO module. -->
<script src="https://atlas.microsoft.com/sdk/javascript/spatial/0/atlas-spatial.min.js"></script>
</head>
<body>
<input type="file" name="inputfile" id="inputfile">
<script type="text/javascript">
window.onload = function() {
var input = document.getElementById('inputfile');
input.addEventListener('change', function() {
var fr = new FileReader();
fr.onload = function(){
atlas.io.read(fr.result).then(function(r){
//r is the parsed data. Do something with it.
});
}
fr.readAsText(input.files[0]);
});
});
</script>
</body>
</html>

Infinite redirecting loop CoovaChilli

I'm working with an accesspoint with OPENWRT and I want to redirect the hosts connected via Wifi to a concrete page. The problem is that when I turn on the browser appears infinite loop saying "redirecting", and this all the time.
I have tried to modify the chilli config file by adding:
HS_REDIRSSL=on
HS_SSLKEYFILE=/etc/chilli/key.pem
HS_SSLCERTFILE=/etc/chilli/cert.pem
but I'm still having the same problem. Could someone help me?
This is my html code to redirect the hosts:
<html>
<head>
<meta http-equiv="refresh" content="0; url=http://footanalytics.com/" />
</head>
<body>
<font size="3" face="verdana" color="black">
<i>REDIRECTING</i>
</font>
</body>
</html>
Thank you
Try with this, edit this file: /etc/config/coovachilli, at the end of this file:
config general 'hotspot2'
option mode 'norad'
option net '192.168.3.254/24'
option enabled '1'
option externalpage '1'
option uamlogoutip '1.1.1.1'
option defidletimeout '600'
option defsessiontimeout '600'
option period '3'
option day '1'
option externadress 'http://example.com'
enabled '1' enables the wifi
external page '1' enables the option to redirect you to a requiered page when you connect to wifi
externadress defines the adrees where you want to be redirected
Don't touch the other options, they are configured by default.
bernat

Error:The connection to the server was unsuccessfull(fake) in Angularjs App

I am creating an angular app with Intel XDK.I have data on local storage.when I run the app in offline a message will appear after few minutes like "Application error:The connection to the server was unsuccessful(fake)" and stop the application spontaneously.how to manage this.I expect a hopeful solution to recover this.
app.js
$scope.checkConnection=function() {
var networkState = navigator.connection.type;
if(networkState == Connection.NONE){
$scope.footer_message = "No Network Connection";
return false;
}else{
$scope.footer_message = "Obidos Technologies (P) Ltd";
return true;
}
}
$scope.checkConnection();
If you are seeing inconsistent/transient error messages saying something like [Connection to server was unsuccessful to “www/assets/index.html”] when starting up your app. This is caused by your App timing out. You can either increase the time-out time, but will only reduce the frequency of the issue, or you can:
1.Rename your index.html to “main.html”
2.Create a new “index.html” and put the following content into it:
<!doctype html>
<html>
<head>
<title>tittle</title>
<script>
window.location='./main.html';
</script>
<body>
</body>
</html>
3.Rebuild your app! No more errors!

AngularJS error when added as script

I just added those srcipt to my web page and has en error.
<script type="text/javascript" src="https://code.angularjs.org/1.3.0-rc.1/angular.js"></script>
<script type="text/javascript" src="https://code.angularjs.org/1.3.0-rc.1/angular-route.js"></script>
This is exact my example and it works on Fiddle.
http://jsfiddle.net/frbrn32d/2/
junk after document element main.html:6
DOMException [NS_ERROR_DOM_BAD_URI: "Access to restricted URI denied"
code: 1012
nsresult: 0x805303f4
location: https://code.angularjs.org/1.3.0-rc.1/angular.js:9032]
Check out your fiddle. I made a change and it seems to be working.
You had a typo there. It should be alert not alerT.
http://jsfiddle.net/1mjgf4u8/3/

wpf webBrowser NavigateToString script error

I want to use the Wpf webBrowser control to render math equations.
I've downloaded MathJax, and included it in my Visual studio project.
I've tryed to load one of the MathJax example. This is the html code i'm using:
<!DOCTYPE html>
<html>
<head>
<title>MathJax MathML Test Page</title>
<!-- Copyright (c) 2010-2012 Design Science, Inc. -->
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<script type="text/javascript" src="MathJax-Reduced/unpacked/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full"></script>
</head>
<body>
<p>
When
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>a</mi><mo>≠</mo><mn>0</mn>
</math>,
there are two solutions to
<math xmlns="http://www.w3.org/1998/Math/MathML">
<mi>a</mi><msup><mi>x</mi><mn>2</mn></msup>
<mo>+</mo> <mi>b</mi><mi>x</mi>
<mo>+</mo> <mi>c</mi> <mo>=</mo> <mn>0</mn>
</math>
and they are
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
<mi>x</mi> <mo>=</mo>
<mrow>
<mfrac>
<mrow>
<mo>−</mo>
<mi>b</mi>
<mo>±</mo>
<msqrt>
<msup><mi>b</mi><mn>2</mn></msup>
<mo>−</mo>
<mn>4</mn><mi>a</mi><mi>c</mi>
</msqrt>
</mrow>
<mrow> <mn>2</mn><mi>a</mi> </mrow>
</mfrac>
</mrow>
</math>
</p>
</body>
</html>
Everything is working fine with the following code:
string curDir = Directory.GetCurrentDirectory();
this.webBrowser1.Navigate(new Uri(String.Format("file:///{0}/test-1.html", curDir)));
But if i try this code:
string s = File.ReadAllText(Directory.GetCurrentDirectory() + "\\test-1.html");
this.webBrowser1.NavigateToString(s);
i get a Script Error:
An error has occurred in the script on this page.
Line: 1
Char: 1
Error: Syntax Error
Code: 0
URL: about:MathJax-Reduced/unpacked/MathJax.js?config=TeX-AMS-MML_HTMLorMML-full
What's wrong? It would be really helpful to use something similar to the last code, so i can avoid to save a file just to load it...
Note that the URL in the error is about:MathJax-Reduced/unpacked..., which is an about URL not the file:// URL that you had in the first case. I suspect that is the cause of the problem. That suggests that the NavigateToString function is using about:blank or a similar URL as the base URL for the page, so MathJax is getting the wrong path to itself. Note that you lose the actual page location when reading it from the file and loading it as a string. That means you may have to load MathJax from an absolute URL rather than a relative one (i.e., include the file:// and path to the MathJax-Reduced directory).

Resources