-3

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.

code-guy
  • 31
  • 5

2 Answers2

0

What you need is JSONP. Here is more on that

Community
  • 1
  • 1
Daniel Dykszak
  • 276
  • 2
  • 6
0

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.

code-guy
  • 31
  • 5