开发者

Strategies to let a separate app talk to javascript in the browser

Here's the scenario: we have a separate app running on a computer (outside of the browser). It creates a folder with 10,000 downloaded thumbnail images.

In the browser, we have a traditional browser app. It lets you browse through these imag开发者_开发知识库es. In order to speed up the browsing dramatically, I want to let the app get the images from the local drive, if available, ie. img src="C:/..." instead of img src="http://..."

The app can talk to the server, and let it know the path to the images.

I'm trying to figure out how to (lightweight) let the browser know that on this particular computer, we have a folder with images, whereas on another particular computer, we may not.

My best guess so far is have the app write a cookie to the browser. Is that the easiest/most elegant/most lightweight way of doing this?


The app could just add some javascript variable to the page. e.g. for PHP

if($hasImagesFolder) echo "var hasImagesFolder = true;";
else echo "var hasImagesFolder = false;";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜