从脚本中检索值并用它替换DIV

时间:2018-04-05 03:38:28

标签: javascript jquery html

我正在尝试从下面的代码中检索"city"的值,在这种情况下是 Bothell ,并使用该文本替换HTML中的DIV。这是代码:

$(document).ready(function() {
  var f = function() {
    realgeeks.analytics.send_activity({
      "site_uuid": "09bce392-c259-4c5b-ba82-02547e30f980",
      "property": {
        "city": "**Bothell**",
        "full_baths": 3,
        "listing_status": "ACTIVE",
        "year_built": 1984,
        "zip": "98012",
        "listing_days_on_market": 3,
        "url": "http://www.bothellhomes.com/property/1265902/",
        "sqft": "1306",
        "tags": ["Snohomish", "Southeast Snohom",
          "Thrashers Corner", "Parkshore", "Bothell",
          "98012", "Parkshore Div 4", "1265902",
          "Northshore"
        ],
        "longitude": -122.204533,
        "beds": 3,
        "mls": "1265902",
        "state": "WA",
        "images": [
          "https://property-media.realgeeks.com/40/8039f526bebf11225fda49555d1f4217.jpg",
          "https://property-media.realgeeks.com/40/cd649b5ae431bec9fe4a5802a6520f5e.jpg",
          "https://property-media.realgeeks.com/40/a43099b8b8b30772b019ac2aaea3460f.jpg"
        ],
        "latitude": 47.830478,
        "listing_price": "440000",
        "type": "Single Family Residential",
        "list_date": "2018-04-01T00:00:00+00:00",
        "street_address": "18430 20th Dr SE"
      },
      "type": "property_viewed"
    });
  };
  f();
  $(document).on('fb-lead-login', f);
});

如果由于我的网络提供商而无法访问此代码块,我将如何进行此操作?

0 个答案:

没有答案