I'm currently learning how to use new Cloud Functions for Firebase and the problem I'm having is that I can't access the function I wrote through an AJAX request. I get the "No... moreI'm currently learning how to use new Cloud Functions for Firebase and the problem I'm having is that I can't access the function I wrote through an AJAX request. I get the "No 'Access-Control-Allow-Origin'" error. Here's an example of the function I wrote:
exports.test = functions.https.onRequest((request, response) => {
response.status(500).send({test: 'Testing functions'});
})
The function sits in this url: https://us-central1-fba-shipper-140ae.cloudfunctions.net/test
Firebase docs suggests to add CORS middleware inside the function, I've tried it but it's not working for me: https://firebase.google.com/docs/functions/http-events
This is how I did it:
var cors = require('cors');
exports.test = functions.https.onRequest((request, response) => {
cors(request, response, () => {
response.status(500).send({test: 'Testing functions'});
})
})
What am I doing wrong? I would appreciate any help with this.UPDATE:Doug Stevenson's answer helped. Adding ({origin: true}) fixed the issue, I... less
I have a non-public Tableau Dashboard that I load through aspx file, which supplies the required authentication, username and password, and allows the site visitor to view the... moreI have a non-public Tableau Dashboard that I load through aspx file, which supplies the required authentication, username and password, and allows the site visitor to view the tableau on the website, with the ticket it receives.
So, now, I want the Tableau to load on the website with filters already applied through the Javascript API.
Or, how can I use the "onFirstInteractive" option of the Javascript? The problem is I don't need to use the Javascript API to load the Tableau but just need it to apply filters on the Dashboard.
function tableauFilter (){
var placeholderDiv = document.getElementById("viz2"); // Don't need this
var url = "https://public.tableau.com/views/Test_1228/Dashboard1" // Don't need this either
var options = {
onFirstInteractive : function(FilterName,Value){ //This is what I want to be able to use
activesheet = viz.getWorkbook().getActiveSheet();
1) Users are prompted to login to Tableau when viewing an embedded dashboard within a web application.
2) If they close their browser, start a different browser session, or let... more1) Users are prompted to login to Tableau when viewing an embedded dashboard within a web application.
2) If they close their browser, start a different browser session, or let the Tableau cookie expire, they will be prompted to login again.
3) Throughout the day, you could potentially be prompted to login multiple times when trying to view dashboards. This quickly becomes annoying and tiresome.
Tableau offers a solution called "Trusted Authentication" which bypasses the manual login process. After a week of debugging and troubleshooting, I was able to accomplish this. I could not find any solutions on Stackoverflow, so I wanted to share my knowledge on how I accomplished this in hope to help others. less
Below is a fully functional and working code . When I copy paste it to a text file testFile.html and then open it with a browser it works fine.But I want the selectCollege... moreBelow is a fully functional and working code . When I copy paste it to a text file testFile.html and then open it with a browser it works fine.But I want the selectCollege function to execute right after the initViz functionI tried this<body onload="initViz();selectCollege('Engineering');"> . . .But it didn't work. How can I make the selectCollege function to execute right after the initViz ?
<!DOCTYPE html>
<html>
I'm getting the below error while trying to run the javascript code in attempt to render a view from my tableau server which has trusted authentication.While trying to run the JS... moreI'm getting the below error while trying to run the javascript code in attempt to render a view from my tableau server which has trusted authentication.While trying to run the JS code, the view is not getting rendered in the browser, however, if I log in to my tableau server on one tab and run the JS in another tab, the view is getting rendered as its taking the authentication from the browser cache.Error says:Refused to display < url> in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.Code:
<script type="text/javascript"
src="http://<tableau server URL of the view>"></script>
<script type="text/javascript">
function initViz() {
var containerDiv = document.getElementById("vizContainer"),
url = "<Tableau server URL of the view>",
options = {
hideTabs: true,
onFirstInteractive: function () {
console.log("Run this code when the viz has finished loading.");
}
};
var viz... less
I was wondering if I could set up a lambda function for AWS, triggered whenever a new text file is uploaded into an s3 bucket. In the function, I would like to get the contents of... moreI was wondering if I could set up a lambda function for AWS, triggered whenever a new text file is uploaded into an s3 bucket. In the function, I would like to get the contents of the text file and process it somehow. I was wondering if this was possible...?
For example, if I upload foo.txt, with contents foobarbaz, I would like to somehow get foobarbaz in my lambda function so I can do stuff with it. I know I can get metadata from getObject, or a similar method.
Thanks!