문제

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.

도움이 되었습니까?

해결책 2

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.

다른 팁

What you need is JSONP. Here is more on that

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top