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条回答

    报告相同问题?

    悬赏问题

    • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
    • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
    • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
    • ¥20 腾讯企业邮箱邮件可以恢复么
    • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
    • ¥15 错误 LNK2001 无法解析的外部符号
    • ¥50 安装pyaudiokits失败
    • ¥15 计组这些题应该咋做呀
    • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
    • ¥15 让node服务器有自动加载文件的功能