最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Result of API Request to global variable?

programmeradmin2浏览0评论

I have an API Request for weather and the account of this weather stuff has a limitation of requests per minute. In my theme I have the weather information twice on the same page. So if I would make a function of the request it would fire twice. I thought about a global variable, where I could save the request once and grap this variable where ever I want.

Is this a good idea? I read something about, that global variables aren't a good choice!? Is there an other solution?

发布评论

评论列表(0)

  1. 暂无评论