开发者

Show JavaScript widget only on index/main page?

开发者 https://www.devze.com 2023-03-09 22:50 出处:网络
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 read

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

精彩评论

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