RegExp vs indexOf

JavaScript performance comparison

Revision 19 of this test case created

Info

Compare speed of Regex with indexOf for simple string comparison

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var string = '<!DOCTYPE html><html><head><meta charset="utf-8"><script type="text/javascript">window.NREUM||(NREUM={}),__nr_require=function(e,n,t){function r(t){if(!n[t]){var o=n[t]={exports:{}};e[t][0].call(o.exports,function(n){var o=e[t][1][n];return r(o||n)},o,o.exports)}return n[t].exports}if("function"==typeof __nr_require)return __nr_require;for(var o=0;o<t.length;o++)r(t[o]);return r}({QJf3ax:[function(e,n){function t(e){function n(n,t,a){e&&e(n,t,a),a||(a={});for(var u=c(n),f=u.length,s=i(a,o,r),p=0;f>p;p++)u[p].apply(s,t);return s}function a(e,n){f[e]=c(e).concat(n)}function c(e){return f[e]||[]}function u(){return t(n)}var f={};return{on:a,emit:n,create:u,listeners:c,_events:f}}function r(){return{}}var o="nr@context",i=e("gos");n.exports=t()},{gos:"7eSDFh"}],ee:[function(e,n){n.exports=e("QJf3ax")},{}],3:[function(e,n){function t(e){return function(){r(e,[(new Date).getTime()].concat(i(arguments)))}}var r=e("handle"),o=e(1),i=e(2);"undefined"==typeof window.newrelic&&(newrelic=window.NREUM);var a=["setPageViewName","addPageAction","setCustomAttribute","finished","addToTrace","inlineHit","noticeError"];o(a,function(e,n){window.NREUM[n]=t("api-"+n)}),n.exports=window.NREUM},{1:12,2:13,handle:"D5DuLP"}],gos:[function(e,n){n.exports=e("7eSDFh")},{}],"7eSDFh":[function(e,n){function t(e,n,t){if(r.call(e,n))return e[n];var o=t();if(Object.defineProperty&&Object.keys)try{return Object.defineProperty(e,n,{value:o,writable:!0,enumerable:!1}),o}catch(i){}return e[n]=o,o}var r=Object.prototype.hasOwnProperty;n.exports=t},{}],D5DuLP:[function(e,n){function t(e,n,t){return r.listeners(e).length?r.emit(e,n,t):void(r.q&&(r.q[e]||(r.q[e]=[]),r.q[e].push(n)))}var r=e("ee").create();n.exports=t,t.ee=r,r.q={}},{ee:"QJf3ax"}],handle:[function(e,n){n.exports=e("D5DuLP")},{}],XL7HBI:[function(e,n){function t(e){var n=typeof e;return!e||"object"!==n&&"function"!==n?-1:e===window?0:i(e,o,function(){return r++})}var r=1,o="nr@id",i=e("gos");n.exports=t},{gos:"7eSDFh"}],id:[function(e,n){n.exports=e("XL7HBI")},{}],G9z0Bl:[function(e,n){function t(){var e=d.info=NREUM.info,n=f.getElementsByTagName("script")[0];if(e&&e.licenseKey&&e.applicationID&&n){c(p,function(n,t){n in e||(e[n]=t)});var t="https"===s.split(":")[0]||e.sslForHttp;d.proto=t?"https://":"http://",a("mark",["onload",i()]);var r=f.createElement("script");r.src=d.proto+e.agent,n.parentNode.insertBefore(r,n)}}function r(){"complete"===f.readyState&&o()}function o(){a("mark",["domContent",i()])}function i(){return(new Date).getTime()}var a=e("handle"),c=e(1),u=window,f=u.document;e(2);var s=(""+location).split("?")[0],p={beacon:"bam.nr-data.net",errorBeacon:"bam.nr-data.net",agent:"js-agent.newrelic.com/nr-768.min.js"},d=n.exports={offset:i(),origin:s,features:{}};f.addEventListener?(f.addEventListener("DOMContentLoaded",o,!1),u.addEventListener("load",t,!1)):(f.attachEvent("onreadystatechange",r),u.attachEvent("onload",t)),a("mark",["firstbyte",i()])},{1:12,2:3,handle:"D5DuLP"}],loader:[function(e,n){n.exports=e("G9z0Bl")},{}],12:[function(e,n){function t(e,n){var t=[],o="",i=0;for(o in e)r.call(e,o)&&(t[i]=n(o,e[o]),i+=1);return t}var r=Object.prototype.hasOwnProperty;n.exports=t},{}],13:[function(e,n){function t(e,n,t){n||(n=0),"undefined"==typeof t&&(t=e?e.length:0);for(var r=-1,o=t-n||0,i=Array(0>o?0:o);++r<o;)i[r]=e[n+r];return i}n.exports=t},{}]},{},["G9z0Bl"]);</script><script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","queueTime":0,"licenseKey":"46aac887f0","agent":"js-agent.newrelic.com/nr-768.min.js","transactionName":"YgdbYxFYCkcDAEINX1tNf0INWhBdDQ0ZA1hqA1pUDFQJWwYCQg1fWxEXQQpcE0dYAlUHX1gPVlMCTQ1bDA==","applicationID":"6440214","errorBeacon":"bam.nr-data.net","applicationTime":288}</script><title>Luxury Treehouse in Washington State | Glamping in Washington</title><meta name="description" content="Rent this beautiful treehouse near Mount Adams in Washington State and discover the glamping experience of a lifetime." /><meta name="keywords" content="luxury camping washington, glamping washington, luxury camping mount adams washington, glamping mount adams washington, luxury treehouse rental washington, luxury treehouse stay washington, luxury treehouse hotel washington, luxury treehouse stay washington, unique camping accommodations washington, luxury camping accommodations washington, luxury camping accommodations mount adams washington" /><meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"><meta name="content-language" content="en"><link rel="apple-touch-icon" sizes="57x57" href="/static/img/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="114x114" href="/static/img/apple-touch-icon-114x114.png"><link rel="apple-touch-icon" sizes="72x72" href="/static/img/apple-touch-icon-72x72.png"><link rel="apple-touch-icon" sizes="144x144" href="/static/img/apple-touch-icon-144x144.png"><link rel="apple-touch-icon" sizes="60x60" href="/static/img/apple-touch-icon-60x60.png"><link rel="apple-touch-icon" sizes="120x120" href="/static/img/apple-touch-icon-120x120.png"><link rel="apple-touch-icon" sizes="76x76" href="/static/img/apple-touch-icon-76x76.png"><link rel="apple-touch-icon" sizes="152x152" href="/static/img/apple-touch-icon-152x152.png"><link rel="apple-touch-icon" sizes="180x180" href="/static/img/apple-touch-icon-180x180.png"><link rel="icon" type="image/png" href="/static/img/favicon-192x192.png" sizes="192x192"><link rel="icon" type="image/png" href="/static/img/favicon-160x160.png" sizes="160x160"><link rel="icon" type="image/png" href="/static/img/favicon-96x96.png" sizes="96x96"><link rel="icon" type="image/png" href="/static/img/favicon-16x16.png" sizes="16x16"><link rel="icon" type="image/png" href="/static/img/favicon-32x32.png" sizes="32x32"><meta name="msapplication-TileColor" content="#da532c"><meta name="msapplication-TileImage" content="/static/img/mstile-144x144.png"><meta property="og:site_name" content="Glamping Hub" /><meta property="og:title" content="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington" /><meta property="og:type" content="product" /><meta property="og:price:amount" content="186" /><meta property="og:price:currency" content="USD" /><meta property="og:description" content="Nestled at the foot of scenic, snow-capped Mt. Adams, this charming treehouse is not only in a place of wild beauty, but it&#39;s also ideal for a romantic glamping trip." /><meta property="place:location:latitude" content="45.8369265" /><meta property="place:location:longitude" content="-121.394919" /><meta property="place:region" content="Washington" /><meta property="og:rating" content="5.0" /><meta property="og:rating_scale" content="5" /><meta property="og:rating_count" content="1" /><meta property="og:image" content="https://djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams20.jpg" /><link rel="stylesheet" href="/static/CACHE/css/e63a9fa0a18e.css" type="text/css" /><!--[if IE 8]><link rel="stylesheet" type="text/css" href="/static/css/ie8.css" /><![endif]--><!--[if lte IE 9]><link rel="stylesheet" type="text/css" href="/static/css/ie9.css" /><![endif]--><link rel="stylesheet" href="/static/CACHE/css/caec66e9d19e.css" type="text/css" /></head><body data-target=".subnav" data-offset="50" class="accommodation"><!--STARTS Main Header--><header><div class="container-fluid"><div class="row"><div class="col-sm-12 col-md-12 col-lg-12"><a class="brand" href="/"><img alt="GlampingHub" src="/static/main/img/logo.png" /></a><nav class="navbar navbar-default hidden-xs hidden-sm"><ul class="nav navbar-nav menu"><li><a href="" class="submenu-toggle" data-toggle="types-glamping">Types of glamping<span class="fa fa-caret-down"></span></a></li><li><a href="" class="submenu-toggle" data-toggle="destinations">Destinations<span class="fa fa-caret-down"></span></a></li><li><a href="" class="submenu-toggle" data-toggle="collections">Collections<span class="fa fa-caret-down"></span></a></li><li class="navbar-link-buy-gift-card"><a href="/vouchers/gifts/">Buy Gift Card</a></li><li class="hidden-md"><a href="/blog/">Blog</a></li><li class="dropdown"><a id="preferred-currency" href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"><span class="fa fa-usd"></span></a><ul class="dropdown-menu" id="currency-menu" role="menu"><li><a href="#" data-currency="USD"><span class="fa fa-usd"></span> United States dollar</a></li><li><a href="#" data-currency="EUR"><span class="fa fa-eur"></span> Euro</a></li><li><a href="#" data-currency="GBP"><span class="fa fa-gbp"></span> Pound sterling</a></li><li><a href="#" data-currency="CAD"><span class="fa fa-usd"></span> Canadian dollar</a></li><li><a href="#" data-currency="AUD"><span class="fa fa-usd"></span> Australian dollar</a></li><li><a href="#" data-currency="NZD"><span class="fa fa-usd"></span> New Zealand dollar</a></li><li><a href="#" data-currency="JPY"><span class="fa fa-jpy"></span> Japanese yen</a></li></ul></li><li class="login-button dropdown"><a href="/login/">Log in</a><ul></ul></li></ul><div class="submenu hide" id="types-glamping"><div class="container"><ul class="row"><li class="col-sm-2 col-md-2 col-lg-2"><a href="/rentalsearch/tree-houses/"><i class="gh-tree-houses"></i><span>Tree Houses</span></a></li><li class="col-sm-2 col-md-2 col-lg-2"><a href="/rentalsearch/yurts/"><i class="gh-yurts"></i><span>Yurts</span></a></li><li class="col-sm-2 col-md-2 col-lg-2"><a href="/rentalsearch/safari-tents-glamping/"><i class="gh-safari-tents"></i><span>Safari Tents</span></a></li><li class="col-sm-2 col-md-2 col-lg-2"><a href="/rentalsearch/caravans-campervans-airstreams/"><i class="gh-campervans"></i><span>Campervans</span></a></li><li class="col-sm-2 col-md-2 col-lg-2"><a href="/rentalsearch/tipis-teepees/"><i class="gh-tipis"></i><span>Tipis</span></a></li><li class="col-sm-2 col-md-2 col-lg-2"><a href="/rentalsearch/luxury-tents/"><i class="gh-tents"></i><span>Tents</span></a></li></ul></div><div class="bottom-link"><ul><li><a href="/rentalsearch/cabins/">Cabins</a></li><li><a href="/rentalsearch/domes/">Domes</a></li><li><a href="/rentalsearch/eco-pods/">Eco-Pods</a></li><li><a href="/rentalsearch/nature-lodges/">Nature Lodges</a></li><li><a href="/rentalsearch/caves/">Caves</a></li><li><a href="/types-of-glamping/">See all</a></li></ul></div></div><div class="submenu hide" id="destinations"><div class="container"><ul class="row"><li class="col-sm-2 col-md-2 col-lg-2"><a href="/unitedstatesofamerica/pacificwest/california/"><span>California</span></a></li><li class="col-sm-2 col-md-2 col-lg-2"><a href="/unitedstatesofamerica/pacificwest/washington/"><span>Washington</span></a></li><li class="col-sm-2 col-md-2 col-lg-2"><a href="/unitedstatesofamerica/midatlantic/newyork/"><span>New York</span></a></li><li class="col-sm-2 col-md-2 col-lg-2"><a href="/unitedstatesofamerica/mountainstates/colorado/"><span>Colorado</span></a></li><li class="col-sm-2 col-md-2 col-lg-2"><a href="/canada/ontario/"><span>Ontario</span></a></li><li class="col-sm-2 col-md-2 col-lg-2"><a href="/canada/britishcolumbia/"><span>British Columbia</span></a></li></ul></div><div class="bottom-link"><ul><li><a href="/rentalsearch/us-canada-glamping-sites/">US & Canada</a></li><li><a href="/rentalsearch/caribbean-mexico-glamping/">Caribbean and Latin America</a></li><li><a href="/rentalsearch/europe-glamping-sites/">Europe</a></li><li><a href="/rentalsearch/luxury-camping-australia/">Australia</a></li><li><a href="/rentalsearch/africa-safari-accommodations/">Africa</a></li><li><a href="/glamping-destinations/">See all</a></li></ul></div></div><div class="submenu hide" id="collections"><div class="container"><ul class="row"><li class="col-sm-3 col-md-3 col-lg-3 col-sm-offset-2 col-md-offset-2 col-lg-offset-2"><ul><li><a href="/rentalsearch/tree-houses/"><i class="gh-tree-houses"></i><span>Tree Houses</span></a></li><li><a href="/rentalsearch/luxury-tents/"><i class="gh-tents"></i><span>Luxury Tents</span></a></li><li><a href="/rentalsearch/best-most-popular-luxury-camping-USA/"><i class="gh-accommodation"></i><span>Best Luxury Camping in the US</span></a></li></ul></li><li class="col-sm-3 col-md-3 col-lg-3"><ul><li><a href="/rentalsearch/us-canada-glamping-sites/"><i class="gh-wanderlust"></i><span>US & Canada</span></a></li><li><a href="/rentalsearch/europe-glamping-sites/"><i class="gh-wanderlust"></i><span>Europe</span></a></li><li><a href="/rentalsearch/featured-hosts/"><i class="gh-accommodation"></i><span>Featured Hosts</span></a></li></ul></li><li class="col-sm-3 col-md-3 col-lg-3"><ul><li><a href="/rentalsearch/eastcoast-glamping-accommodations/"><i class="gh-wanderlust"></i><span>East Coast Glamping Sites</span></a></li><li><a href="/rentalsearch/luxury-camping-upstate-new-york/"><i class="gh-wanderlust"></i><span>Glamping in Upstate New York</span></a></li><li><a href="/rentalsearch/most-visited-glamping-sites/"><i class="gh-accommodation"></i><span>Most Visited Glamping Sites</span></a></li></ul></li></ul></div><div class="bottom-link"><ul><li><a href="/glamping-collections/">See all collections</a></li><li><a href="/glamping-geocollections/">See all geocollections</a></li></ul></div></div></nav></div></div></div></header><div id="breadcrumbs" class="hidden-xs"><div class="container-fluid"><div class="row"><div class="col-sm-12 col-md-12 col-lg-12"><ol><li><a href="/">Home</a><span class="breadcrumb-separator">/</span></li><li><a href="/unitedstatesofamerica/">United States</a><span class="breadcrumb-separator">/</span></li><li><a href="/unitedstatesofamerica/pacificwest/">Pacific West</a><span class="breadcrumb-separator">/</span></li><li><a href="/unitedstatesofamerica/pacificwest/washington/">Washington</a><span class="breadcrumb-separator">/</span></li><li><a href="/unitedstatesofamerica/pacificwest/washington/whitesalmon/">White Salmon</a><span class="breadcrumb-separator">/</span></li><li class="active">Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington</li></ol></div></div></div></div><div id="main"><div id="accommodation" data-pk="1469" itemscopeitemtype="http://schema.org/Place"><div class="accommodation-two-colums"><div class="accommodation-content"><div class="accommodation-content-wrap"><div class="carousel-container"><div class="front fotorama" data-nav="thumbs" data-transition="crossfade" data-autoplay="7000" data-loop="true" data-width="100%" data-ratio="770/474"><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams20.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams20.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams1.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams1.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams4.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams4.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams3.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams3.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams5.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams5.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams6.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams6.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams8.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams8.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams9.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams9.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams10.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams10.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams11.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams11.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams7.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams7.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams12.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams12.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams14.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams14.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams15.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams15.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams16.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams16.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams17.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams17.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams18.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams18.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams19.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams19.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a><a href="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams2.jpg"><img itemprop="image" src="//djo0taav7vu6c.cloudfront.net/accommodations/washington-treehouse-nestled-foot-scenic-snow-capped-mt-adams2.jpg" alt="Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington"/></a></div><a id="view-map" href="#">View map<span class="fa fa-chevron-right"></span></a><div class="accommodation-title"><h1 itemprop="name">Tree House Cabin Nestled at the Foot of Scenic, Snow-Capped Mt. Adams, Washington</h1><h2><i class="gh-map-pin"></i><span>White Salmon, Washington (United States)</span></h2></div><div class="hide" id="map-container"></div></div><ul class="nav nav-tabs nav-justified accommodation-menu hidden-xs" role="tablist"><li class="active"><a href="#details" role="tab" data-toggle="tab">Details</a></li><li><a href="#features" role="tab" data-toggle="tab">Features</a></li><li><a href="#activities" role="tab" data-toggle="tab">Activities</a></li><li><a href="#reviews" role="tab" data-toggle="tab">Reviews</a></li></ul><div class="tab-content"><div class="container-fluid tab-pane accommodation-tab active" id="details"><div class="row"><div class="accommodation-tab-titles col-sm-12 col-md-3 col-lg-3"><ul><li><span>Tree House</span></li><li class="units">1 <span>unit</span></li><li>2 nights<span>minimum stay</span></li><li>4 p.m. <span>check-in</span></li><li>11 a.m. <span>check-out</span></li><li><form id="contact-host-launcher-form" action="." method="get"><input id="open-contact-host" type="button"class="button"value=\'Contact host\'></form></li></ul></div><div class="accommodation-tab-content col-sm-12 col-md-9 col-lg-9"><h3>Description of Glamping Units</h3><p><p>The tree house has two floors. The second floor lies amid the towering Douglas firs with windows providing stunning views in every direction. A hand-crafted, circular staircase provides access to this floor. There is also a full-size log bed that was hand-crafted from Western Red cedar. </p><p>All amenities necessary for a relaxing stay at the tree house are provided for your use. The kitchen is complete with all standard appliances including utensils, dishes, and a propane barbecue on the front deck. The year-round hot tub on the deck adjacent to the living room will increase your enjoyment of this serene setting.</p></p><h3>Location + Surroundings</h3><p><p>Located only 80 miles from Portland, Oregon, and across the Columbia River from Hood River, in historic White Salmon, Washington, this romantic tree house is nestled at the foot of scenic, snow-capped Mt. Adams. This charming, one-of-a-kind tree house is the ideal romantic glamping trip. This is in a place of wild beauty. Enjoy leisurely walks or relax in the privacy of the hot tub located on the deck. Rain, snow, or shine, the beauty and serenity surrounding the tree house is unique and exhilarating. </p><p>The summer is a beautiful time to visit the tree house. It offers a cool alternative to the dust and heat many have grown so accustomed to in the city.</p><p>During the winter, the cozy warmth of the wood stove, the gently-falling snowflakes, and the quiescent, snow-blanketed earth will leave guests in absolute bliss.</p></p><h3>Additional information</h3><p><p>Double occupancy: The basic nightly fee is for two people, but the property can accommodate up to four guests. If there are more than two guests, the hosts will charge an extra $10.00/night per guest and send a revised booking offer to incorporate those charges. </p><p>Although dog-friendly, some restrictions and cautions apply. Please contact the hosts for additional information.</p><p>Check-In Time is 4:00pm, Check-Out is 11:00am</p></p></div></div></div><div class="container-fluid tab-pane accommodation-tab hidden-xs" id="features"></div><div class="container-fluid tab-pane accommodation-tab hidden-xs" id="activities"><div class="row"><div class="accommodation-tab-titles col-sm-12 col-md-3 col-lg-3"><h4>Summary</h4></div><div class="accommodation-tab-content col-sm-12 col-md-9 col-lg-9"><p><p>The Columbia Gorge is famous around the world for recreation, culture and adventure activities. The treehouse is smack dab in the geographic center of the Columbia Gorge Scenic area, which makes it a very convenient base for day trips to other places of interest. Here are some suggestions:</p><p>Windsurfing and wind-sailing<br />Kayaking<br />Mountain biking<br />White water rafting<br />Rock climbing<br />Snow ski or snowboard year round<br />Cross country skiing<br />Water skiing<br />Hiking<br />Golfing<br />Fishing<br />Horseback riding<br />Mountain climbing<br />Picking huckleberries</p></p></div></div><div class="row"><div class="accommodation-tab-titles col-sm-12 col-md-3 col-lg-3"><h4>Activities</h4></div><div class="accommodation-tab-content col-sm-12 col-md-9 col-lg-9"><ul class="icon-list"><li><i class="gh-biking"></i><span>Biking</span></li><li><i class="gh-bird-watching"></i><span>Bird watching</span></li><li><i class="gh-canoeing"></i><span>Canoeing</span></li><li><i class="gh-caving"></i><span>Caving</span></li><li><i class="gh-climbing"></i><span>Climbing</span></li><li><i class="gh-fishing"></i><span>Fishing</span></li><li><i class="gh-golf"></i><span>Golfing</span></li><li><i class="gh-hiking"></i><span>Hiking</span></li><li><i class="gh-horseback-riding"></i><span>Horseback riding</span></li><li><i class="gh-kayaking"></i><span>Kayaking</span></li><li><i class="gh-sightseeing"></i><span>Sightseeing</span></li><li><i class="gh-micro-flights"></i><span>Microlight flights</span></li><li><i class="gh-photography"></i><span>Photography</span></li><li><i class="gh-rafting"></i><span>Rafting</span></li><li><i class="gh-restaurant"></i><span>Dining</span></li><li><i class="gh-sailing"></i><span>Sailing</span></li><li><i class="gh-skiing"></i><span>Skiing</span></li><li><i class="gh-surfing"></i><span>Surfing</span></li><li><i class="gh-walking"></i><span>Walking</span></li><li><i class="gh-wine-tasting"></i><span>Wine tasting</span></li><li><i class="gh-skiing"></i><span>Winter sports</span></li><li><i class="gh-"></i><span>Water sports</span></li></ul></div></div></div><div class="container-fluid tab-pane accommodation-tab hidden-xs" id="reviews"><div class="row"><div class="accommodation-tab-rating col-sm-12 col-md-12 col-lg-12"><ul><li><span><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></span><span>Uniqueness</span></li><li><span><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></span><span>Cleanliness</span></li><li><span><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></span><span>Comfort</span></li><li><span><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></span><span>Activities</span></li><li><span><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></span><span>Location/Surroundings</span></li><li><span><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></span><span>Overall Experience</span></li></ul></div></div><div class="row"><div class="accommodation-tab-titles col-sm-12 col-md-3 col-lg-3"><p class="review-rating"><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></p><p>Michael  Johnson</p><p class="review-date">Mar 2015</p></div><div class="accommodation-tab-content col-sm-12 col-md-9 col-lg-9"><p class="review-text">Wonderful experience.  Have recommended to friends, and will definitely come back again!</p></div></div></div></div></div></div><div class="accommodation-sidebar"><section class="rating-price"><div class="container-fluid"><div class="row"><div class="rating col-sm-4 col-md-4 col-lg-4"><span class="stars"><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i><i class="fa fa-star"></i></span><span>reviews</span></div><div class="price-container col-sm-8 col-md-8 col-lg-8"><p>from <span class="price short"><i class="fa fa-usd"></i>186</span> per night</p></div></div></div></section><section><form id="availability-form" action="." method="get"><div class="date-container"><input id="checkin-date" name="booking_checkin" placeholder="Check-in" type="text" /><input id="checkout-date" name="booking_checkout" placeholder="Check-out" type="text" /><select class="form-control select select-primary select-block mbl" id="id_booking_guests" name="booking_guests"><option value="1">1 guest</option><option value="2" selected="selected">2 guests</option><option value="3">3 guests</option><option value="4">4 guests</option></select></div><p class="availability-loader"><i class="fa fa-spinner fa-spin"></i></p><input id="availability-submit" type="submit" class="submit"value="Request Booking"></form><p class="service-fee">Some units of this accommodation have per person rates. The prices displayed above are for double occupancy.</p><p class="service-fee">Taxes and Service Fee included.</p></section><section><h5>Top activities:</h5><ul class="icon-list"><li><i class="gh-"></i><span>Water sports</span></li><li><i class="gh-skiing"></i><span>Winter sports</span></li><li><i class="gh-wine-tasting"></i><span>Wine tasting</span></li><li><i class="gh-walking"></i><span>Walking</span></li></ul></section><section><h5>Summary:</h5><p itemprop="description"><p>Nestled at the foot of scenic, snow-capped Mt. Adams, this charming treehouse is not only in a place of wild beauty, but it&#39;s also ideal for a romantic glamping trip.</p></p></section><section><h5>Popular features:</h5><ul class="icon-list"><li><i class="gh-spa"></i><span>Spa</span></li><li><i class="gh-grill"></i><span>BBQ grill</span></li><li><i class="gh-balcony"></i><span>Deck or balcony</span></li></ul></section><section id="also-like" class="recommendations hidden-xs"><h4>You may also like</h4><div id="also-like-container"><p class="text-center"><i class="fa fa-spinner fa-spin"></i></p></div></section></div></div><div itemprop="geo" itemscope itemtype="http://schema.org/GeoCoordinates"class="hidden"><span itemprop="latitude">45.8369265</span><span itemprop="longitude">-121.394919</span></div></div><div class="modal fade" id="contact-host-modal"><div class="modal-dialog"><div class="modal-content"><div class="modal-header"><button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button></div><div class="modal-body"><div id="contact-host"><form role="form" id="ajax-contact-host"><h2>Contact host</h2><p class="help-block">Do you still have questions about this listing? Send the host a message detailing your inquiry.</p><input type=\'hidden\' name=\'csrfmiddlewaretoken\' value=\'Jxa7enr9WEWc4UAV3gLkN9AVOLij6NCq\' /><div class="form-group"><input class="form-control" id="id_name" maxlength="30" name="name" placeholder="your name" required="required" type="text" /></div><div class="form-group"><input class="form-control" id="id_email" maxlength="254" name="email" placeholder="your email" required="required" type="text" /></div><div class="form-group"><input class="form-control" id="id_email2" maxlength="254" name="email2" placeholder="repeat your email" required="required" type="text" /></div><div class="form-group"><input class="form-control" id="id_phone" maxlength="15" name="phone" placeholder="your phone" required="required" type="text" /></div><div class="row without-margins"><p class="help-block">Please indicate the date you’d like to stay.</p><div class="col-xs-4 form-group"><input class="form-control" id="id_booking_checkin" name="booking_checkin" placeholder="Check-in" type="text" /></div><div class="col-xs-4 form-group"><input class="form-control" id="id_booking_checkout" name="booking_checkout" placeholder="Check-out" type="text" /></div><div class="col-xs-4 form-group"><select class="form-control" id="id_booking_guests" name="booking_guests"><option value="1">1 guest</option><option value="2">2 guests</option><option value="3">3 guests</option><option value="4">4 guests</option></select></div></div><div class="form-group"><textarea class="form-control" cols="40" id="id_message" name="message" placeholder="Your message to the host" rows="10"></textarea></div><div class="form-group"><script src=\'https://www.google.com/recaptcha/api.js?hl=en\'></script><script type="text/javascript">var DjangoRecaptchaOptions = {"lang": "en"};if (typeof RecaptchaOptions !== \'object\') {RecaptchaOptions = DjangoRecaptchaOptions;} else {for (key in DjangoRecaptchaOptions) {RecaptchaOptions[key] = DjangoRecaptchaOptions[key];}}</script><div class="g-recaptcha" data-sitekey="6Lf6zQUTAAAAALhyzzy-Xl_4Oc_RYZlmI7WiB-nJ"></div><noscript><div style="width: 302px; height: 352px;"><div style="width: 302px; height: 352px; position: relative;"><div style="width: 302px; height: 352px; position: absolute;"><iframe src="https://www.google.com/recaptcha/api/fallback?k=6Lf6zQUTAAAAALhyzzy-Xl_4Oc_RYZlmI7WiB-nJ"frameborder="0" scrolling="no"style="width: 302px; height:352px; border-style: none;"></iframe></div><div style="width: 250px; height: 80px; position: absolute; border-style: none;bottom: 21px; left: 25px; margin: 0px; padding: 0px; right: 25px;"><textarea id="g-recaptcha-response" name="g-recaptcha-response"class="recaptcha_challenge_field"style="width: 250px; height: 80px; border: 1px solid #c1c1c1;margin: 0px; padding: 0px; resize: none;" value=""></textarea><input type=\'hidden\' name=\'recaptcha_response_field\' value=\'manual_challenge\' /></div></div></div></noscript></div><div class="form-group"><input type="submit" class="btn btn-primary text-capitalize" id="contact-host-modal-send" value="Send Message"></div></form><div id="privacy-policy"><p><small>Please be aware that due to our privacy policy, we do not allow Guests and Hosts to exchange personal information (phone numbers, email addresses, physical addresses, or property names) in the communication thread until a booking is confirmed. At that point you will receive all the aforementioned information. Questions? Call our Support Team at: (+1) 415 800 3004. Happy Glamping!</small></p></div><div id="sucessful-contact-host" class="hidden"><h2>Your message was sent!</h2><p class="help-block">We’ve sent you an email with a link to your message thread with the host.</p><h4>You can also continue searching;</h4><form class="mini-search-box"><div class="form-group"><div class="input-group"><input type="text" class="form-control"><span class="input-group-addon"><span class="fa fa-search"></span></span></div></div></form><h4>Or see our recommmendations below</h4><div class="suggestions"></div></div></div></div><!-- /.modal-body --></div><!-- /.modal-content --></div><!-- /.modal-dialog --></div><!-- /.modal --></div><footer><div class="container"><div class="row"><div class="footer-links col-xs-12"><div class="row"><div class="col-xs-12 col-sm-6"><div class="row"><div class="col-xs-12 col-sm-6"><h5>Join Us on</h5><ul><li><a href="https://www.facebook.com/glampinghub" target="_blank">Facebook</a></li><li><a href="https://twitter.com/GlampingHub" target="_blank">Twitter</a></li><li><a href="http://www.pinterest.com/glampinghub" target="_blank">Pinterest</a></li><li><a href="http://instagram.com/glampinghub" target="_blank">Instagram</a></li><li><a href="https://plus.google.com/+Glampinghub" target="_blank">Google Plus</a></li></ul></div><div class="col-xs-12 col-sm-6"><h5>Discover</h5><ul><li><a href="/whats-glamping/">What’s Glamping</a></li><li><a href="/types-of-glamping/">Types of Glamping</a></li><li><a href="/glamping-destinations/">Destinations</a></li><li><a href="/glamping-collections/">Collections</a></li><li><a href="/glamping-geocollections/">Geocollections</a></li></ul></div><div class="col-xs-12"><a name="subscribe-newsletter" id="subscribe-newsletter"></a><form class="subscribe-newsletter-form" method="POST"><input type=\'hidden\' name=\'csrfmiddlewaretoken\' value=\'Jxa7enr9WEWc4UAV3gLkN9AVOLij6NCq\' /><input id="subscribe-newsletter-form-email" name="email" type="email" placeholder="Your email address" required><input type="submit" value="Subscribe to our newsletter" class="pre-subscribe-button hidden-xs hidden-sm hidden-md"><button title="Subscribe to our newsletter" type="submit" class="pre-subscribe-button visible-xs visible-sm visible-md"><span class="fa fa-envelope"></span></button><input disabled type="submit" value="Thank you!" class="post-subscribe-button hidden"><button title="Thank you!" disabled type="submit" class="post-subscribe-button hidden"><span class="fa fa-check"></span></button></form></div></div></div><div class="col-xs-12 col-sm-6"><div class="row"><div class="col-xs-12 col-sm-6"><h5>Company</h5><ul><li><a href="/faq/">FAQ</a></li><li><a href="/terms-and-conditions/">Terms and Conditions</a></li><li><a href="/privacy-policy/">Privacy Policy</a></li><li><a href="/cancellation-policies/">Cancellation Policies</a></li><li><a href="/contact-us/">Contact and Feedback</a></li></ul></div><div class="col-xs-12 col-sm-6"><h5>Hosts</h5><ul><li><a href="/list-with-us/">Become a host</a></li><li><a href="/claim-your-listing/">Claim your listing</a></li><li class="hidden-lg"><a href="/dashboard/hosts-login/">Host login</a></li></ul><h5>Manufacturers & Vendors</h5><ul><li><a href="/manufacturers/">Manufacturers List</a></li><li><a href="/list-with-us-manufacturer/">List with us</a></li></ul></div></div></div></div></div></div></div></footer><div class="modal fade" id="signup-login-modal"><div class="modal-dialog"><div class="modal-content"><div class="modal-body"><div id="signup"><h2>Sign Up for Free</h2><h3>Create your free Glamping Hub account now.</h3><form role="form" id="ajax-signup"><input type=\'hidden\' name=\'csrfmiddlewaretoken\' value=\'Jxa7enr9WEWc4UAV3gLkN9AVOLij6NCq\' /><div class="form-group"><input type="text" class="form-control" requiredid="signup-modal-first-name" placeholder="first name"></div><div class="form-group"><input type="text" class="form-control" requiredid="signup-modal-last-name" placeholder="last name"></div><div class="form-group"><input type="text" class="form-control"id="signup-modal-phone-number"placeholder="phone number"></div><div class="form-group"><input type="email" class="form-control" requiredid="signup-modal-email" placeholder="email"></div><div class="form-group"><input type="email" class="form-control" requiredid="signup-modal-email-2" placeholder="retype email"></div><p class="help-block">By clicking Sign Up, you agree to the <a href="/terms-and-conditions/">Terms and Conditions</a> and the <a href="/cancellation-policies/">Cancellation Policies</a></p><button class="btn btn-primary text-capitalize" id="signup-modal-action">Sign Up</button></form></div><div id="login"><h2>Log In</h2><p class="separator">or</p><form role="form" id="ajax-login"><div class="form-group"><input type="email" class="form-control" requiredid="login-modal-email" placeholder="email"></div><div class="form-group"><input type="password" class="form-control" requiredid="login-modal-password" placeholder="password"></div><div class="alert alert-danger hidden" role="alert"><button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button><span class="generalMessage"><strong>An unknown error happened</strong>,please try again later.</span><span class="customMessage"></span></div><p class="forgot"><a href="/reset-password/">Forgot your password/email?</a></p><div class="text-right"><button class="btn btn-primary text-capitalize" id="login-modal-action">Log In</button></div><ul><li>Save a list of your favorite glamping sites</li><li>Message Glamping Hosts</li><li>Manage your upcoming bookings</li></ul></form></div></div></div><!-- /.modal-content --></div><!-- /.modal-dialog --></div><!-- /.modal --><script>(function(i,s,o,g,r,a,m){i[\'GoogleAnalyticsObject\']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,\'script\',\'//www.google-analytics.com/analytics.js\',\'ga\');ga(\'create\', \'UA-19512439-1\', \'glampinghub.com\');ga(\'require\', \'displayfeatures\');if (!(window.GH && window.GH.avoidDefaultGAPageView)) {ga(\'send\', \'pageview\');}</script><script>// TODO DELETE when the internationalization branch is mergefunction gettext(text) {return text;}// END DELETE</script><script type="text/javascript" src="/static/CACHE/js/814c9589f72a.js"></script><script>if (_.isUndefined(window.GH)) { window.GH = {}; }window.GH.loginAjaxUrl = \'/ajax-login/\';window.GH.signupAjaxUrl = \'/ajax-signup/\';window.GH.signupUrl = \'/signup/\';window.GH.guestsDashboardUrl = \'/bookings/\';window.GH.user = {isAuthenticated: \'\' === \'True\',isHost: \'False\' === \'True\',isGuest: \'\' === \'True\',isStaff: \'\' === \'True\'};$(document).ready(function () {$(\'.submenu-toggle\').on(\'click\', function (evt) {evt.preventDefault();var $reference = $(evt.target),$target = $reference.data(\'toggle\');$(\'.submenu-toggle\').removeClass(\'open\');$(\'.submenu\').addClass(\'hide\');$target = $(\'#\' + $target);$target.removeClass(\'hide\');});$(document).on(\'click\', function (evt) {var $el = $(evt.target);if (!$el.is(\'.submenu-toggle\')) {$(\'.submenu\').addClass(\'hide\');}});$(\'.subscribe-newsletter-form\').submit(function(evt){evt.preventDefault();ga(\'send\', \'event\', \'button\', \'click\', \'user subscribes to newsletter\');$(\'.subscribe-newsletter-form .pre-subscribe-button\').removeClass(\'hidden-xs hidden-sm hidden-md visible-xs visible-sm visible-md\').addClass(\'hidden\');$(\'.subscribe-newsletter-form .post-subscribe-button\').removeClass(\'hidden\');$(\'.subscribe-newsletter-form input.post-subscribe-button\').addClass(\'hidden-xs hidden-sm hidden-md\');$(\'.subscribe-newsletter-form button.post-subscribe-button\').addClass(\'visible-xs visible-sm visible-md\');$.post(\'/newsletter/subscribe/\', $(".subscribe-newsletter-form").serialize());$(\'.subscribe-newsletter-form input[name=email]\').prop(\'disabled\', true);});$(\'.navbar-link-buy-gift-card\').on(\'click\', function () {ga(\'send\', \'event\', \'button\', \'click\', \'user clicks on navbar link to buy gift card\');});});</script><script src="//maps.google.com/maps/api/js?sensor=true&amp;language=en"></script><script type="text/javascript" src="/static/CACHE/js/69fe20f50139.js"></script><script>$(\'select\').select2();new GH.DateRangeManager(\'#checkin-date\', \'#checkout-date\', {loadData: GH.obtainCalendarData});new GH.DateRangeManager(\'#ajax-contact-host #id_booking_checkin\', \'#ajax-contact-host #id_booking_checkout\', {loadData: GH.obtainCalendarData});$(document).ready(function () {var mapFirstTime = true,$map = $(\'#map-container\'),$slider = $(\'.front.fotorama\'),textView = \'View map\',textHide = \'Hide map\';$(\'#view-map\').on(\'click\', function (evt) {evt.preventDefault();var $link = $(evt.target),text = $map.is(\'.hide\') ? textHide : textView ;$(\'html, body\').animate({ scrollTop: 0 }, 500);$slider.toggleClass(\'hide\');$map.toggleClass(\'hide\');$link.toggleClass(\'in-map\');if (mapFirstTime) {mapFirstTime = false;GH.initMap(\'#map-container\', [JSON.parse(\'{"latitude": 45.83692649999997, "longitude": -121.39491900000002}\')], false);}$link.text(text);});var ajaxFormFailHandler, doSearch;$(\'#open-contact-host\').click(function() {ga(\'send\', \'event\', \'button\', \'click\', \'user opens contact host form\');$(\'#contact-host-modal [name=booking_checkin]\').val($("#availability-form [name=booking_checkin]").val());$(\'#contact-host-modal [name=booking_checkout]\').val($("#availability-form [name=booking_checkout]").val());$(\'#contact-host-modal [name=booking_guests]\').val($("#availability-form [name=booking_guests]").val()).select2();$(\'#contact-host-modal\').modal(\'show\');});ajaxFormFailHandler = function (formSelector, jqXHR) {if (jqXHR.status == 400) {var errors = JSON.parse(jqXHR.responseText);var firstError = true;for (index in errors) {if (index == \'captcha\') {errors[\'g-recaptcha\'] = errors[index];index = \'g-recaptcha\';var jqitem = $(formSelector + \' .\' + index);} else {var jqitem = $(formSelector + \' #id_\' + index);}if (jqitem.length) {if (firstError) {firstError = false;jqitem.focus();}if (!jqitem.parent(\'.form-group\').children(\'span.error\').length) {jqitem.parent(\'.form-group\').append($(\'<span id="id_\'+index+\'-error" class="error error-tip" for="\'+index+\'">\'+errors[index]+\'</span>\'));jqitem.parent(\'.form-group\').addClass(\'has-error\');}} else {var submitButton = $(formSelector + \' input[type=submit]\');submitButton.before($(\'<span id="id_\'+index+\'-error" class="error error-tip">\'+errors[index]+\'</span>\'));}}} else {var submitButton = $(formSelector + \' input[type=submit]\');submitButton.before($(\'<span id="id_unknow-error" class="error error-tip">Unknow error, please try later.</span>\'));}};$(\'#ajax-contact-host\').submit(function(e) {e.preventDefault();ga(\'send\', \'event\', \'button\', \'click\', \'user contacts host\');var formData = $(\'#contact-host-modal #ajax-contact-host\').serializeArray();$(\'#contact-host-modal #ajax-contact-host :input\').prop(\'disabled\', true);$(\'#contact-host-modal #ajax-contact-host .form-group\').removeClass(\'has-error\');$(\'#contact-host-modal #ajax-contact-host .error-tip\').remove();$.post(\'/ajax-contact-host/1469/\', formData).done(function() {var html = $(\'#also-like-container\').html();$(\'#sucessful-contact-host .suggestions\').html(html);$(\'#sucessful-contact-host .mini-search-box input\').val(\'\');$(\'#privacy-policy\').addClass(\'hidden\');$(\'#contact-host-modal #ajax-contact-host\').addClass(\'hidden\');$(\'#contact-host-modal #sucessful-contact-host\').removeClass(\'hidden\');$(\'#contact-host-modal #ajax-contact-host #id_message\').val(\'\');}).fail(function(e) {ajaxFormFailHandler(\'#contact-host-modal #ajax-contact-host\', e);}).always(function() {if ($(\'.g-recaptcha\').length) grecaptcha.reset();$(\'#contact-host-modal #ajax-contact-host :input\').prop(\'disabled\', false);});});$(\'#contact-host-modal\').on(\'hidden.bs.modal\', function (e) {$(\'#privacy-policy\').removeClass(\'hidden\');$(\'#contact-host-modal #ajax-contact-host\').removeClass(\'hidden\');$(\'#contact-host-modal #sucessful-contact-host\').addClass(\'hidden\');});doSearch = function (query) {var checkin = $(\'#contact-host-modal [name=booking_checkin]\').val(),checkout = $(\'#contact-host-modal [name=booking_checkout]\').val(),guests = $(\'#contact-host-modal [name=booking_guests]\').val(),url = \'/rentalsearch/?q=\' + encodeURIComponent(query);if (checkin) { url += \'&checkin=\' + encodeURIComponent(checkin); }if (checkout) { url += \'&checkout=\' + encodeURIComponent(checkout); }if (guests) { url += \'&guests=\' + encodeURIComponent(guests); }window.location = url;};$(\'#sucessful-contact-host .mini-search-box .input-group-addon\').on(\'click\', function (evt) {evt.preventDefault();doSearch($(\'#sucessful-contact-host .mini-search-box input\').val());});$(\'#sucessful-contact-host .mini-search-box input\').typeahead({items: 8,minLength: 3,source: function (query, process) {return $.get(\'/autocomplete/\', { q: query }, function (data) {return process(data.options);});}});});</script><script src="//assets.pinterest.com/js/pinit.js" data-pin-hover="true" async data-pin-color="red"></script></body></html>';
};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
RegEx
if (/id="breadcrums"/.test(string)) {}
pending…
indexOf
if (-1 !== string.indexOf('id="breadcrums"')) {}
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Comment form temporarily disabled.

Add a comment