Сравнение версий

Ключ

  • Эта строка добавлена.
  • Эта строка удалена.
  • Изменено форматирование.

...

Блок кода
languagejs
titleExample
linenumberstrue
{
	"name        {
            "id": "standard_240x4005",
	"js": "createGIADelement = function(element) {\n          var item = document.createElement(\"div\");\n"name": "testDynamicCreativeSnippetJS",
         item.setAttribute(\"class\",\"__gi_item\");\n   "advertiser_id": "45",
         var link = document.createElement(\"a\");\n    item.appendChild(link);\n    link.setAttribute(\"href\",element['url']);\n    link.setAttribute(\"target\",\"_blank\");\n    var image = document.createElement(\"img\");\n    link.appendChild(image);\n    image.setAttribute(\"src\",element['picture']);\n    var desc = document.createElement(\"div\");\n    link.appendChild(desc);\n    desc.setAttribute(\"class\",\"__gi_desc\");\n    desc.appendChild(document.createTextNode(element['name']));\n    var price = document.createElement(\"div\");\n    link.appendChild(price);\n    price.setAttribute(\"class\",\"__gi_price\");\n    price.appendChild(document.createTextNode(element['price'] + \" \" + element['currencySymbol']));\n\n    return item;\n}\n\ncreateGIADlogo = function(logoImg) {\n    var logo = document.createElement(\"div\");\n    if (logoImg && logoImg!==\"\"){\n      logo.setAttribute(\"class\",\"__gi_header\");\n      var link = document.createElement(\"a\");\n      logo.appendChild(link);\n      link.setAttribute(\"href\",\"[[LANDING_PAGE]]\");\n      link.setAttribute(\"target\",\"_blank\");\n      var sp = document.createElement(\"span\");\n      link.appendChild(sp);\n      var image = document.createElement(\"img\");\n      sp.appendChild(image);\n      image.setAttribute(\"src\", logoImg);\n    }\n    return logo;\n}\n\nvar domain = (typeof __GetI_domain) == \"undefined\" ? \"px.adhigh.net\" : __GetI_domain;\nvar src = ('https:' == document.location.protocol ? 'https://' : 'http://') + domain + '/ad240x400.css';\ndocument.write(\"<link rel='stylesheet' type='text/css' href='\"+src+\"'/>\");\n\nvar container = document.createElement(\"div\");\ncontainer.setAttribute(\"class\",\"_gi_ad_240x400\");\ndocument.getElementById(elementId).appendChild(container);\nvar siteLogo = \"[[SITE_LOGO]]\";\nif (siteLogo){\n    siteLogo = ('https:' == document.location.protocol ? 'https://' : 'http://') + siteLogo; \t  \n}\ncontainer.appendChild(createGIADlogo(siteLogo));\nfor(var i=0; i<products.length && i<4; i++) {\n  container.appendChild(createGIADelement(products[i]));\n}"
 "js": "var s = '<div style=\"padding: 6px 10px 0px 15px;border: 1px solid black;border-radius: 10px;\"'; for(var i=0; i<products.length && i<3; i++) {   var product=products[i]; s += '<p style=\"margin-top: 0px;\"><a href=\"' + product['url'] + '\"><img class=\"productImg\" src=\"' + product['picture'] + '\"/><br>' + product['name'] + ' <br> ' + product['price'] + ' руб.</a><br>'; } s+='</div>'; document.getElementById(elementId).innerHTML += s;",
            "css": "#creative_[[FUNCTION_NAME]] { border: 0px solid black; font-size: 10pt; font-family: Geneva, Arial, Helvetica, sans-serif; padding: 10px; } #creative_[[FUNCTION_NAME]] .productImg{width:100px;height:80px;}"
        }