dongzi8191 2017-06-04 12:14
浏览 143

如何在HTML / Javascript / PHP中使用全局变量?

I have the following setting: My Raspberry Pi is connected to a display. The Raspberry Pi shows a HTML-Webpage with a RSS Newsfeed. The Raspberry Pi also hosts a Configuration Web-page

The HTML that shows the RSS looks like this:

<script type="text/javascript" src="FeedEk.js"></script>
<script type="text/javascript">
    var feed=function(){
      $('#divRss').FeedEk({
        **FeedUrl: 'http://www.tagesschau.de/xml/rss2'**,
        MaxCount: 5,
        ShowDesc: true,
        ShowPubDate: true,
        DescCharacterLimit: 100,
        DateFormat: 'L',
        DateFormatLang: 'en'
      });
    ;}

feed();

setInterval(feed, 10*60*1000);

</script>

<div id="divRss"></div>

The Variable FeedUrl is currently hard coded and decides which RSS-Feed to be shown.

Now I want to have a config-file with the FeedUrl.

The Configuration Webpage should write the FeedUrl in the config-file. And the HTML should read the FeedUrl from the config-file. As you can see I dont know which file format the config file should be.

Current Situation

The Config-Webpage should be like this. When you click the button the URL should be saved in the config-file

<form>
<label for="URL">URL: </label>
<input type="text" id="FeedURL" name="URL">

<button type="submit">SAVE!"</button>
</form>

=> So my Questions are: 1. Which file format do I need to save and extract information? 2. How can I write information in the file? 3. How do I read the informations from the file?

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 求差集那个函数有问题,有无佬可以解决
    • ¥15 【提问】基于Invest的水源涵养
    • ¥20 微信网友居然可以通过vx号找到我绑的手机号
    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题