开发者

Show JavaScript widget only on index/main page?

I tried to integrate Twitter (via JavaScript widget) into a (static) blog page; now it shows up everywhere. Is it possible to show it only on the main 开发者_JS百科page and hide it when a visitor reads a sub-page or blog entry?


if(window.location != '/<your main page address>') {
  //do sth to hide or do not show
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜