본문 바로가기

[자바스크립트] 랜덤 텍스트 줄 광고용

2021. 2. 7. 댓글 1
반응형

텍스트 줄 광고를 랜덤으로 보여주고 싶을 때 사용하면 유용한 자바스크립트 코드 입니다.

 

운영 중인 사이트 게시판 상단에 줄광고를 넣고 싶은데 이왕이면 사람들이 접속할 때마다 다른 광고를 노출하고 싶었습니다. 그래서 구글링해서 찾은 소스 입니다.

 

아래와 같이 만들어서 게시판 상단에 노출되게 했습니다.

 

실제 적용한 사이트:

url.kr/g5/bbs/board.php?bo_table=clean0_0site_0zl3l

 

단축URL-링크주소 줄이기, url 단축 서비스

긴 링크주소 url을 짧게 줄여 주는 단축URL 서비스 입니다.

url.kr

 

<!-- Board TOP AD[S] -->
<center>
<script language="JavaScript" type="text/JavaScript">
	var banner=new Array();
	banner[0]="<a href='#' target='_blank' rel='noopener noreferrer'>[AD] 이벤트/프로모션 <span style='background-color:#FFF880;color:#BF0000;font-weight:bold;'>아이폰 SE/11 시리즈 빅 세일</span></a>";
	banner[1]="<a href='#' target='_blank' rel='noopener noreferrer'>[AD] 이벤트/프로모션 <span style='background-color:#FFF880;color:#BF0000;font-weight:bold;'>마이크로소프트 서피스 시리즈 기획전</span></a>";
	banner[2]="<a href='#' target='_blank' rel='noopener noreferrer'>[AD] 이벤트/프로모션 <span style='background-color:#FFF880;color:#BF0000;font-weight:bold;'>설 선물세트 특가</span></a>";
	
	var random_banner=Math.floor(Math.random()*(banner.length));
</script>

<script>document.write(banner[random_banner]);</script>
</center>
<!-- Board TOP AD[E] -->

 

 

오늘도 내가 필요한 생활코딩을 찾아서 적용까지 마쳤습니다.

반응형

◀ 댓글 ▶ 1

  • novaco 2022.05.17 12:25

    How to prevent breast cancer

    Reference article from the source: http://novaco.vn/cao-duoc-lieu/
    According to the latest statistics in the US, about 1 in 8 women in the world have an increased risk of breast cancer and increased mortality compared to other cancers. Studies show that dietary and food factors can help effectively control breast cancer risk and aid in speeding up the recovery process for those battling the disease. Source: http://novaco.vn/

    Isoflavones

    Soy isoflavones are a group of phytoestrogens, plant-derived compounds with estrogenic activity. Many studies have found that moderate soy consumption is protective against breast cancer. http://tinyurl.com/yah5qj2h


    In addition, genistein, the main isoflavones in soy, has been shown to protect against cancer by interfering with hormone signaling pathways and influencing genes involved in reproduction and death of cancer cells.
    A new study has found that girls who ate soy during childhood and adolescence have a significantly lower risk of breast cancer in adulthood. Other studies show that consumption of soy foods containing genistein during adulthood protects against both premenopausal and postmenopausal breast cancer.

    Carrot

    Carrots are high in antioxidant carotenoids like beta-carotene and alpha-carotene, which help protect against breast cancer. In a large study published in the American Journal of Clinical Nutrition, women with the highest blood levels of carotenoids had an 18 to 28 percent lower risk of breast cancer. Other carotenoid-rich foods include peppers, pumpkin, sweet potatoes, and green vegetables like kale.
    You can chop carrots and mix them with vegetables to make a carrot salad, you can also mash carrots with chickpeas, garlic and olive oil or make carrot soup or soup.

    Onion

    Onions contain many organosulfur compounds, which have the effect of preventing tumor growth in breast cancer and other cancers. Other foods rich in organosulfur compounds include yellow onions, garlic, leeks, and chives. Onions also contain quercetin and anthocyanin (a water-soluble pigment responsible for the red color).
    It also protects you against breast cancer. You can saute the shallots, shaved Brussels sprouts and mushrooms in olive oil;, cut the purple onion in half, mix with melted coconut oil, honey and balsamic vinegar and roast until tender; Thinly sliced ​​purple onion, put in a jar and cover with apple cider vinegar to quickly pickle.

    Broccoli sprouts

    Broccoli, which resembles alfalfa sprouts, has sulforophane, a sulfur-containing compound with anticancer activities. Studies show that sulforaphane can inhibit the growth of breast cancer cells and induce apoptosis of breast cancer cells.
    They are also rich in fiber, which may protect against breast cancer by altering hormonal activities. Other foods high in sulforaphane include broccoli, cabbage, Brussels sprouts, kale, and cauliflower.
    You can: Blend broccoli sprouts, bananas, pineapple, and coconut milk into a creamy smoothie. Or use them in salads or salads.

    Linseed

    Flaxseeds contain compounds called lignans, phytoestrogens that can enhance or inhibit the effects of estrogen. In postmenopausal women, lignans may cause the body to produce less active forms of estrogen, potentially reducing the risk of breast cancer.
    They are also rich in alpha-linolenic acid, an omega-3 fat that has been shown in studies to stop the growth, size, and proliferation of cancer cells and promote cell death. breast cancer cells.

    Broccoli

    Broccoli contains many cancer-preventing compounds, especially glucosinolates, a group of sulfur-containing substances that are responsible for the spicy, bitter taste of cruciferous vegetables. Glucosinolates are broken down by the body into bioactive compounds such as isothiocyanates and indoles, which have been shown to inhibit cancer cell growth and promote cancer cell death. .
    A new study shows that women who eat a lot of cruciferous vegetables, such as kale, turnips, broccoli and cabbage, have a 17% lower risk of breast cancer.

    Tea

    Green tea is rich in polyphenols, especially epigallocatechin gallate, a powerful compound that has been shown to inhibit growth.
    http://novaco.vn/nguyen-lieu-duoc-pham-thuc-pham-chuc-nang-s137.html
    bit.ly/caoduoclieu
    bit.ly/nguyenlieutpcn
    bit.ly/nguyenlieuduoc
    bit.ly/giacongduoclieu
    bit.ly/naucaoduoclieu
    bit.ly/caodinhlang
    bit.ly/caomochoatrang
    답글