How to get access to cross domain content? [closed] - javascript

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
Two webpages, http://website.com/home.php and another one is on my dropbox http://dropbox.com/myId/public/myfile.html.
I want to run a user script (which will be given out to other people) on home.php with some values, basically some 9-10 numbers. These values are already defined in the script. But they have to get updated on a regular interval, this is done by the user clicking a link or something. These updated values will be on myfile.html. I have full control over this file.
I have tried using localStorage in the script but that doesn't allow to share content over different domains. iframe also doesn't work due to cross domain. But is there a way that these values can be released by a function() on need.html when the iframe loads on home.php?
I'm pretty new to javascript, so I don't know everything.

What you need is JSONP. Here is more on that

I found out how to do it:
I created a script element using the userscript in home.php which links to need.js instead of need.html.
need.js contains code to add the "values" to localStorage.

Related

web crawling pages with JS events [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
I am trying to get a list of singles released in 2018 from allmusic.com.
It is easy enough to go to their advanced search page and input those parameters, but then I would have to copy and paste the information by hand. All the information is in the html, but it has be generated by clicking the search button and the page navigation buttons. The url itself doesn't change. That puts it well out of my ability to crawl via my limited beautiful soup skills.
Does anyone know how to web crawl java script generated html?
Without looking into the details of the particular website, I imagine you would need to find out what HTTP requests the JS code is making and work backwards from there.
Start by inspecting the network calls (e.g. in Chrome DevTools, just look in the Network tab) and then write something to make those same calls to retrieve the data.

How to make different pages using Javascript and HTML? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm making a (web) app for a school project, using Phonegap. I'm writing IT in Javascript, HTML and CSS, and I am very new to coding.
My question seems to me to be pretty straightforward, but I can't seem to find any solution on the internet.
I have finished my homepage, but now I need a button which directs you to another page (the menu), from where you can go to other pages within the app. But I just can't find out how to make different pages, and how to direct users to those pages.
There are two ways I see you can do this. Either make a new program (new HTML file) and make the button redirect you to that or completely clear the page using document.write("") and rebuild it.

I want to add the button of screenshot of my customer's page and then want it to save in a database and show it in a another page as dashboard [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I tried using java script but it didn't work. I also tried php imagegrabscreen() but it demands URL whereas I have a customer's page URL different for everyone ex: /member.php?email=shady#gmail.com&code=A101_123 .
Basically I want to store user's screenshot so he can be able to see those images of his activity. So any solution?
I would recomment to take a look at html2canvas. It is a JavaScript solution that works on the client side. Only problem: It takes the current DOM from the user and builds a picture with the browser engine. So it is not 100% accurate, but pretty close.

Is there any possibility to insert my own javascript code into any website? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
Imagine a website - for example YouTube. In every video I'd like to insert a link next to the title that will point to my website, and if I click it, it grabs the url and sends it to my site's database.
I've seen somewhere such a possibility (I don't remember where), consisted of the fact that you dragged a *.js file onto your browser window and it worked locally just for you in the browser like an extension to existing site or sth.
Can you point me to articles or other resources if this is possible?
You have a couple options:
You can use a browser extension such as Greasemonkey for Firefox, or Tampermonkey for Chrome.
Write a Bookmarklet.

Types of output that will work for a callback [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 9 years ago.
Improve this question
I am currently working on a small nodejs project that is responsible for returning search terms from a twitter feed. I have the search working however because I am new to this I am having problems displaying this on my webpage. The search information I want to display is being held by a callback from my function and I want to output this information. Keep in mind this information is ascertained after the webpage is loaded and I think that is why response.write(information); is not working for me. However if I do console.log(information); I do get the information I want but it's just not where I want it. Can someone help me out with outputting please.
I ended up solving this by using JSON.stringify(information);
You are right, it's very likely that once you have returned your webpage the response will be closed.
2 options:
1) you load your webpage first on 1 static route (using static middleware) and this web page then does an ajax call to a second route which returns your information.
2) you don't return your webpage until you have retrieved your information. I'm assuming your information will need to be displayed on this webpage which means you'll have to turn your webpage in a template and merge it with your information. You can use a Jade template or underscore template for example.

Categories

Resources