aredridel / html5

Event-driven HTML5 Parser in Javascript
http://dinhe.net/~aredridel/projects/js/html5/
MIT License
590 stars 168 forks source link

Documents with doctypes and attributes on the root node break parser on a previously used document #30

Open sirpy opened 13 years ago

sirpy commented 13 years ago

i'm trying to parse www.tripadvisor.com with "zombie" (for nodejs) which uses html5. the following exception is being thrown.

/media/old/home/benigo/Downloads/nodejs/node_modules/zombie/node_modules/html5/lib/html5/tokenizer.js:62
                throw(e);
    ^
TypeError: Object [ undefined ] has no method 'getAttribute'
    at Object.startTagHtml (/media/old/home/benigo/Downloads/nodejs/node_modules/zombie/node_modules/html5/lib/html5/parser/phase.js:66:35)
    at Object.processStartTag (/media/old/home/benigo/Downloads/nodejs/node_modules/zombie/node_modules/html5/lib/html5/parser/phase.js:41:38)
    at Object.processStartTag (/media/old/home/benigo/Downloads/nodejs/node_modules/zombie/node_modules/html5/lib/html5/parser/before_html_phase.js:31:20)
    at EventEmitter.do_token (/media/old/home/benigo/Downloads/nodejs/node_modules/zombie/node_modules/html5/lib/html5/parser.js:100:20)
    at EventEmitter.<anonymous> (/media/old/home/benigo/Downloads/nodejs/node_modules/zombie/node_modules/html5/lib/html5/parser.js:118:30)
    at EventEmitter.emit (events.js:64:17)
    at EventEmitter.emitToken (/media/old/home/benigo/Downloads/nodejs/node_modules/zombie/node_modules/html5/lib/html5/tokenizer.js:84:7)
    at EventEmitter.emit_current_token (/media/old/home/benigo/Downloads/nodejs/node_modules/zombie/node_modules/html5/lib/html5/tokenizer.js:814:7)
    at EventEmitter.after_attribute_value_state (/media/old/home/benigo/Downloads/nodejs/node_modules/zombie/node_modules/html5/lib/html5/tokenizer.js:558:8)
    at EventEmitter.<anonymous> (/media/old/home/benigo/Downloads/nodejs/node_modules/zombie/node_modules/html5/lib/html5/tokenizer.js:59:25)
aredridel commented 13 years ago

You found a bug!

I'll work on it in the next few days.

aredridel commented 12 years ago

Works in v0.3.4

fkiller commented 12 years ago

Still having an issue. Same error with use of zombie,


var Browser = require("zombie");

// Load the page from localhost
browser = new Browser()
browser.visit("http://www.tripadvisor.com", function () {
//      console.dir(browser.evaluate("document.title"));
});

/Users/freelanceimac1/Projects/heroku-nodejs/node_modules/zombie/node_modules/html5/lib/html5/tokenizer.js:920
                throw(e);
        ^
TypeError: Object [ undefined ] has no method 'getAttribute'
    at Object.startTagHtml (/Users/freelanceimac1/Projects/heroku-nodejs/node_modules/zombie/node_modules/html5/lib/html5/parser/phase.js:74:35)
    at Object.processStartTag (/Users/freelanceimac1/Projects/heroku-nodejs/node_modules/zombie/node_modules/html5/lib/html5/parser/phase.js:41:38)
    at Object.processStartTag (/Users/freelanceimac1/Projects/heroku-nodejs/node_modules/zombie/node_modules/html5/lib/html5/parser/before_html_phase.js:31:20)
    at EventEmitter.do_token (/Users/freelanceimac1/Projects/heroku-nodejs/node_modules/zombie/node_modules/html5/lib/html5/parser.js:99:20)
    at EventEmitter.<anonymous> (/Users/freelanceimac1/Projects/heroku-nodejs/node_modules/zombie/node_modules/html5/lib/html5/parser.js:120:30)
    at EventEmitter.emit (events.js:67:17)
    at EventEmitter.emitToken (/Users/freelanceimac1/Projects/heroku-nodejs/node_modules/zombie/node_modules/html5/lib/html5/tokenizer.js:96:9)
    at emit_current_token (/Users/freelanceimac1/Projects/heroku-nodejs/node_modules/zombie/node_modules/html5/lib/html5/tokenizer.js:848:3)
    at after_attribute_value_state (/Users/freelanceimac1/Projects/heroku-nodejs/node_modules/zombie/node_modules/html5/lib/html5/tokenizer.js:603:4)
    at EventEmitter.<anonymous> (/Users/freelanceimac1/Projects/heroku-nodejs/node_modules/zombie/node_modules/html5/lib/html5/tokenizer.js:917:10)
aredridel commented 12 years ago

Awesome. I'll dig in based on that. Here's hoping TripAdvisor doesn't change in the mean time.

aredridel commented 12 years ago

(also, you generally want to reopen an issue if you can still reproduce)

aredridel commented 12 years ago

Aha! Zombie or JSDom is initializing the parser with an empty document (twice, actually!) before the real parse. I suppose I should detect that and throw an exception. Or so it seems.

aredridel commented 12 years ago

Add an HTML5.enableDebug('parser') in your script and it shows where in the parser it stops.

fkiller commented 12 years ago
Won-Dong-ui-MacBook:zombie fkiller$ node worker.js 
[ 'parser.parse', '&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;' ]
[ 'parser.newPhase', 'initial' ]
[ 'parser.newPhase', 'beforeHTML' ]
[ 'parser.newPhase', 'beforeHead' ]
[ 'parser.newPhase', 'inHead' ]
[ 'parser.newPhase', 'afterHead' ]
[ 'parser.newPhase', 'inBody' ]
[ 'parser.newPhase', 'afterBody' ]
[ 'parser.newPhase', 'afterAfterBody' ]
Zombie: GET http://www.tripadvisor.com/ =&gt; 200
[ 'parser.parse', '&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;/body&gt;&lt;/html&gt;' ]
[ 'parser.newPhase', 'initial' ]
[ 'parser.newPhase', 'beforeHTML' ]
[ 'parser.newPhase', 'beforeHead' ]
[ 'parser.newPhase', 'inHead' ]
[ 'parser.newPhase', 'afterHead' ]
[ 'parser.newPhase', 'inBody' ]
[ 'parser.newPhase', 'afterBody' ]
[ 'parser.newPhase', 'afterAfterBody' ]
[ 'parser.parse',
'<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html xmlns:fb="http://www.facebook.com/2008/fbml" xmlns:og="http://opengraphprotocol.org/schema/">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta http-equiv="imagetoolbar" content="no"/>
<title>Reviews of Hotels, Flights and Vacation Rentals - TripAdvisor</title>
<meta http-equiv="pragma" content="no-cache"/>
<meta http-equiv="cache-control" content="no-cache,must-revalidate"/>
<meta http-equiv="expires" content="0"/>
<meta property="og:image" content="http://c1.tacdn.com/img2/postimg.jpg" height="150px" width="150px"/>
<meta name="keywords" content="vacation, vacations, vacation packages, vacation package, travel package, travel packages, travel, planning, hotel, hotels, motel, bed and breakfast, inn, guidebook, review, reviews, popular, plan, airfare, cheap, discount, map, maps, golf, ski, articles, attractions, advice, restaurants"/>
<meta name="description" content="TripAdvisor - Unbiased hotel reviews, photos and travel advice for hotels and vacations - Compare prices with just one click."/>
<link rel=\'stylesheet\' type=\'text/css\' media=\'screen, print\' href=\'http://c1.tacdn.com/css2/home_2011-v1371748922b.css\'/>
<style type="text/css">
body{}
</style>
</head>
<body class="ltr domn_en_US withFtr globalNav2011_reset">
<div id="fb-root"></div>
<div id="iframediv"></div>
<div id="PAGE">
<div id="HEAD" class="sprite-gradient1x32_grn">
<div class="masthead">
<div class="container">
<span class="topLogo">
<img class="sprite-taLogo" src="http://c1.tacdn.com/img2/x.gif" width="362" height="42" alt="World\'s most trusted travel advice&reg;"/>
</span>
</div>
<div class="navSrch sprite-magGlass_gry" id="SEARCH_LHN">
<form method="get" action="/Search" onsubmit="return ta.call(\'ta.common.search.validate\',event);">
<input id="mainSearch" type="text" name="q" class=" text focusClear" autocomplete="off" onfocus="ta.call(\'ta.widgets.typeahead.factory.global\',event,this,\'SITEWIDE\',\'ta.widgets.typeahead.events.onSelectGlobalTypeAhead\',{maxChoices:16,minLength:3,showOnlyTypedChoices:true,geo:\'\'}); return ta.call(\'ta.common.search.clearOnFocus\',event);" onblur="return ta.call(\'ta.common.search.defaultOnBlur\',event);" value="City, hotel name, etc."/>
<div class="submit_button sprite-gradient1x27_gry"><input id="mainSearchSubmit" onclick="setPID(3825);" onkeydown="var submitPID = function(event) { if(event.key && event.key==\'enter\') setPID(3826); }; submitPID(e);" type="submit" name="sub-search" class="submit" value="SEARCH" title="SEARCH"/></div>
<input type="hidden" name="geo" value=""/>
<input type="hidden" name="returnTo" value="__2F__"/>
</form>
</div>
<div class="tabsBar">
<ul class="tabs">
<li class="tabItemNoLink "><span class="tabNoLink ">
Home
</span>
</li>
<li class="tabItem dropDownJS  hvrIE6"><span class="tabLink arwLink" onmouseover="ta.call(\'ta.common.header.createDrop\', event, this)"><a href="/Hotels" class="arrow_text  pid2972">
Hotels
</a>
<img class="arrow_dropdown_wht sprite-arrow_dropdown_wht" src="http://c1.tacdn.com/img2/x.gif" alt="" width="7" height="5"></span>
<span class="hidden">
<form class=\'subNav\' action=\'/HACSearch\' method=\'get\'/>
<fieldset>
<div class=\'upperInputs\'>
<span class=\'fldSetRadio\'>
<input type=\'radio\' id=\'dropGeoRadio\' name=\'geoOrName\' value=\'geo\' checked=\'true\' onclick="ta.call(\'ta.common.header.changeSearchType\', event, this, \'Search city\')"/>
<label for=\'dropGeoRadio\'>Search city</label>
</span>
<span class=\'fldSetRadio\'>
<input type=\'radio\' id=\'dropNameRadio\' name=\'geoOrName\' value=\'name\' onclick="ta.call(\'ta.common.header.changeSearchType\', event, this, \'Search hotel name\')"/>
<label for=\'dropNameRadio\'>Search hotel name</label>
</span>
<input type=\'text\' id=\'hotelDropText\' class=\'text hasDefault\' name=\'q\' autocomplete=\'off\' value=\'Search city\' onfocus="ta.call(\'ta.common.header.firstClickHotelText\', event, this)"/>
</div>
<div class=\'lowerInputs\'>
<div class=\'wrap\'>
<span class=\'cal first\'>
<input type=\'hidden\' class=\'day\' name=\'inDay\' id=\'inDay\' value=\'29\'/>
<input type=\'hidden\' class=\'month\' name=\'inMonth\' id=\'inMonth\' value=\'06/2012\'/>
<label for=\'checkIn\'>Check-in</label> <input name=\'checkIn\' id=\'checkIn\' class=\'text sprite-calendar-grn\' type=\'text\' value=\'mm/dd/yyyy\' onfocus="ta.call(\'ta.overlays.Factory.createDatedPairedCalendar\', event, this)"/>
</span>
<span class=\'cal\'>
<input type=\'hidden\' class=\'day\' name=\'outDay\' id=\'outDay\' value=\'1\'/>
<input type=\'hidden\' class=\'month\' name=\'outMonth\' id=\'outMonth\' value=\'07/2012\'/>
<label for=\'checkOut\'>Check-out</label> <input name=\'checkOut\' id=\'checkOut\' class=\'text sprite-calendar-grn\' type=\'text\' value=\'mm/dd/yyyy\' onfocus="ta.call(\'ta.overlays.Factory.createDatedPairedCalendar\', event, this)"/>
</span>
</div>
<div class=\'checkPair\'>
<input type=\'checkbox\' name=\'searchAll\' id=\'leaveBlankHotel\' onclick="ta.overlays.toggleSearchAll(event, this)"/>
<label for=\'leaveBlankHotel\'>Leave dates blank</label>
</div>
</div>
<div class="button_2011_grn"><span class="sprite-gradient1x32_grn gradient" onclick="ta.call(\'ta.common.header.submitAndSetPid\', event, this, 5276)">Find Hotels</span></div>
</fieldset>
<br/>
<a class="tchNavPromoLink" href="/TravelersChoice-Hotels" onclick="setPID(16076);">
<div class="tchNavPromo">
<img src="http://c1.tacdn.com/img2/tc/TCH-Hotels-dropdown_L_REG.gif" alt="Travelers\' Choice Hotel Awards"/> <p>The world\'s best hotels. <span class="fkLnk">Get the list</span>.</p> </div>
</a>
</form> </span></li>
<li class="tabItem  hvrIE6"><a href="/Flights" class="tabLink  pid18957" onclick="setPID(1940)">
Flights
</a>
</li>
<li class="tabItem  hvrIE6"><a href="/VacationRentals" class="tabLink  pid4968">
Vacation Rentals
</a>
</li>
<li class="tabItem dropDownJS  hvrIE6"><span class="tabLink arwLink" onmouseover="ta.call(\'ta.common.header.createDrop\', event, this)"><a href="/Restaurants" class="arrow_text  pid2973">
Restaurants
</a>
<img class="arrow_dropdown_wht sprite-arrow_dropdown_wht" src="http://c1.tacdn.com/img2/x.gif" alt="" width="7" height="5"></span>
<span class="hidden">
<form action="/RestaurantSearch" method="get" class="subNav">
<fieldset>
<span class="eatInputs">
<div class="fldSet">
<label for="restaurantCityDrop">City</label>
<input id="restaurantCityDropUrl" type="hidden" value="" name="geo"/>
<input id="restaurantCityDrop" class="text" type="text" name="q" autocomplete="off" onfocus="ta.call(\'ta.widgets.typeahead.factory.standard\', event, this, \'RESTGEO\', \'ta.widgets.typeahead.events.dropEateryOnSelect\', {minLength: 3});"/>
</div>
<select id="dropCuisine" name="cat" class="dropSelect">
<option selected="selected" value="">
All Cuisines </option>
<option value="1" onclick="event.stopPropagation()">
African
</option>
<option value="2" onclick="event.stopPropagation()">
American
</option>
<option value="3" onclick="event.stopPropagation()">
Asian
</option>
<option value="5" onclick="event.stopPropagation()">
Bakery
</option>
<option value="6" onclick="event.stopPropagation()">
Barbecue
</option>
<option value="7" onclick="event.stopPropagation()">
British
</option>
<option value="8" onclick="event.stopPropagation()">
Cafe
</option>
<option value="9" onclick="event.stopPropagation()">
Cajun & Creole
</option>
<option value="10" onclick="event.stopPropagation()">
Caribbean
</option>
<option value="11" onclick="event.stopPropagation()">
Chinese
</option>
<option value="12" onclick="event.stopPropagation()">
Continental
</option>
<option value="13" onclick="event.stopPropagation()">
Delicatessen
</option>
<option value="14" onclick="event.stopPropagation()">
Dessert
</option>
<option value="16" onclick="event.stopPropagation()">
Eastern European
</option>
<option value="17" onclick="event.stopPropagation()">
Fusion/Eclectic
</option>
<option value="18" onclick="event.stopPropagation()">
European
</option>
<option value="20" onclick="event.stopPropagation()">
French
</option>
<option value="21" onclick="event.stopPropagation()">
German
</option>
<option value="22" onclick="event.stopPropagation()">
Global/International
</option>
<option value="23" onclick="event.stopPropagation()">
Greek
</option>
<option value="24" onclick="event.stopPropagation()">
Indian
</option>
<option value="25" onclick="event.stopPropagation()">
Irish
</option>
<option value="26" onclick="event.stopPropagation()">
Italian
</option>
<option value="27" onclick="event.stopPropagation()">
Japanese
</option>
<option value="28" onclick="event.stopPropagation()">
Mediterranean
</option>
<option value="29" onclick="event.stopPropagation()">
Mexican/Southwestern
</option>
<option value="30" onclick="event.stopPropagation()">
Middle Eastern
</option>
<option value="31" onclick="event.stopPropagation()">
Pizza
</option>
<option value="32" onclick="event.stopPropagation()">
Pub
</option>
<option value="33" onclick="event.stopPropagation()">
Seafood
</option>
<option value="34" onclick="event.stopPropagation()">
Soups
</option>
<option value="35" onclick="event.stopPropagation()">
South American
</option>
<option value="36" onclick="event.stopPropagation()">
Spanish
</option>
<option value="37" onclick="event.stopPropagation()">
Steakhouse
</option>
<option value="38" onclick="event.stopPropagation()">
Sushi
</option>
<option value="39" onclick="event.stopPropagation()">
Thai
</option>
<option value="40" onclick="event.stopPropagation()">
Vegetarian
</option>
<option value="41" onclick="event.stopPropagation()">
Vietnamese
</option>
</select>
<select name="pid" id="dropEatPrice" class="dropSelect"> <option selected="selected" value="">
Any Price
</option>
<option value="1" onclick="event.stopPropagation()">$</option>
<option value="2" onclick="event.stopPropagation()">$$</option>
<option value="4" onclick="event.stopPropagation()">$$$</option>
<option value="8" onclick="event.stopPropagation()">$$$$</option>
</select>
</span>
<div class="button_2011_grn"><span class="sprite-gradient1x32_grn gradient" onclick="ta.call(\'ta.common.header.submitAndSetPid\', event, this, 5277)">Find Restaurants</span></div> </fieldset>
</form>
</span></li>
<li class="tabItem  hvrIE6"><a href="/TravelersChoice" class="tabLink  pid5087">
Best of 2012
</a>
</li>
<li id="FRIENDSTAB" class="tabItem tooltip hvrIE6"><a href="/Friends-rnauth" class="tabLink tooltip pid18784" rel="nofollow" onclick="return ta.call(\'ta.common.header.adjustFriendsLink\', event, this);">
Your Friends <span id="FBL" class="sprite-facebook15x15"></span>
</a>
<div class=\'overlayContents\'><div class=\'inner2\'><div class=\'help\'><div class=\'hdr\'>Travel is better with friends.</div><div class=\'ttbody\'>Get inspired by your friends and share your travel plans. <a href=\'/Friends-rnauth\' alt=\'Learn more\' onclick="return ta.call(\'ta.common.header.adjustFriendsLink\', event, this);">Learn more</a></div></div></div></div>
</li>
<li class="tabItem dropDown hvrIE6" onmouseover="ta.call(\'ta.common.header.hideFriendsToolTip\', event, this);">
<span class="tabLink arwLink"><span class="arrow_text">More</span><img class="arrow_dropdown_wht sprite-arrow_dropdown_wht" src="http://c1.tacdn.com/img2/x.gif" alt="" width="7" height="5"></span> <ul class="subNav">
<li class="subItem">
<a href="/Inspiration" class="subLink pid1337">Trip Ideas
</a>
</li>
<li class="subItem">
<a href="/ForumHome" class="subLink ">Travel Forum
</a>
</li>
<li class="subItem">
<a href="/apps" class="subLink pid18876">Apps
</a>
</li>
<li class="subItem">
<a href="http://www.cruisecritic.com/" class="subLink " target="_blank">Cruises
</a>
</li>
<li class="subItem">
<a href="/TravelGuides" class="subLink pid15735">Travel Guides
</a>
</li>
</ul>
</li>
<li class="tabItem altItem warLink sprite-gradient1x32_grn_drk last hvrIE6">
<span class="writeReview fkLnk hvrIE6 tabLink" onclick="ta.util.cookie.setPIDCookie(1434); ta.util.ASDF.asdf(\'LqdWVqg\')">Write a Review</span>
</li>
</ul> </div>
<div id="USER_PREFS" class="prfs">
<ul class="opts">
<li class="optItem fbConnect">
<div class="sprite-facebook15x15 fkLnk hvrIE6  no_cpu " onclick=" ta.store(\'facebook.trackingpid\',1882);  ta.call(\'ta.support.Facebook.loginButton\', event, this);">Sign&nbsp;in&nbsp;with&nbsp;Facebook</div>
</li>
<li class="optItem login"><span class="fkLnk hvrIE6" onClick="ta.util.cookie.setPIDCookie(429);ta.call(\'ta.overlays.Factory.showConnectOverlay\', event, this, {flow: \'MASTHEAD\'}, \'SIGNIN\');">Sign in</span></li>
<li id="register" class="optItem register flyoutX" onclick="ta.util.cookie.setPIDCookie(427); ta.call(\'ta.overlays.Factory.showConnectOverlay\', event, this, {flow: \'MASTHEAD\'}, \'SIGNUP\');"><span class="fkLnk hvrIE6">Register Now!</span>
<li class="optItem" id="MOBHDRLNK">
<span class="fkLnk hvrIE6 optItemLink sprite-mobile_org mobile_org" onClick="ta.util.cookie.setPIDCookie(4109); ta.util.ASDF.asdf(\'LDiHScVb22t\')">FREE Mobile App</span>
</li>
<li id="INTLPOP" class="optItem intSites last" onclick="ta.call(\'ta.overlays.Factory.intlPopup\', event, this)"><span class="sprite-arrow_dropdown_blu arrowDn"><img class="sprite-flag" src="http://c1.tacdn.com/img2/x.gif" alt="International Sites" title="International Sites"/></span></li> </ul> </div> </div> </div>
<div id="HOMEPAGE">
<div class="gridA">
<div class="perfecttripFeaturePromo">
<div class="featurePromo">
<style type="text/css">
.lowerText {  }
</style>
<a id="featurePromoLink" href="/TravelersChoice" onclick="setPID(15201)">
<span id="featurePromoImage" style="background-image: url(\'http://c1.tacdn.com/img2/home/featurepromos/2012_homepage-hero-promo_v2_cocoa.jpg\');">
<span id="featurePromoTextShadow">Where will your travels take you?</span>
<span id="featurePromoText">Where will your travels take you?</span>
<span id="featurePromoCaptionUnderlay">
<span>Cocoa Island Resort, South Male Atoll</span>
</span>
<span id="featurePromoCaption">Cocoa Island Resort, South Male Atoll</span>
</span>
</a>
</div><!--/ featurePromo-->
<div class="perfecttripRD">
<h1>Plan the perfect trip</h1>
<div class="ptptContainerHead">
<ul class="lcol">
<li>
<input type="radio" name="searchtype" value="hotels" id="rdoHotels" onclick="unexpandptpt(true);loadPtptForm(this);" checked="checked"/>
<label for="rdoHotels">Hotels</label> </li>
<li>
<input type="radio" name="searchtype" value="flights" id="rdoFlights" onclick="expandptpt(true);loadPtptForm(this);"/>
<label for="rdoFlights">Flights</label> </li>
<li>
<input type="radio" name="searchtype" value="restaurants" id="rdoRestaurants" onclick="unexpandptpt(true);loadPtptForm(this);"/>
<label for="rdoRestaurants">Restaurants</label> </li>
</ul>
<ul class="rcol">
<li>
<input type="radio" name="searchtype" value="vrs" id="rdoVRs" onclick="unexpandptpt(true);loadPtptForm(this);"/>
<label for="rdoVRs">Vacation rentals</label> </li>
<li>
<input type="radio" name="searchtype" value="thingstodo" id="rdoThingsToDo" onclick="unexpandptpt(true);loadPtptForm(this);"/>
<label for="rdoThingsToDo">Things to do</label> </li>
</ul>
</div><!--/ ptptContainerHead-->
<div class="ptptContainerBody">
<div id="ptptHotels" class="ptptContent active">
<form id="PTPT_HAC_FORM" name="PTPT_HAC_FORM" method="GET" action="/Search" onsubmit="return ta.call(\'ta.common.search.validate\',event);">
<input id="searchbox" type="text" name="q" class="text focusClear" autocomplete="off" onfocus="ta.call(\'ta.widgets.typeahead.factory.ptpt\',event,this,\'HOTELHOME\',\'ta.widgets.typeahead.events.onSelectGlobalTypeAhead\',{maxChoices:16,minLength:3,showOnlyTypedChoices:false,xargs: \'&types=hotel,geo&hglt=true\'});  return ta.call(\'ta.common.search.clearOnFocus\',event);" onblur="return ta.call(\'ta.common.search.defaultOnBlur\',event);" value="Enter city or hotel name"/>
<div class="wrpBtn">
<div class="button ylw lrg">
<input class="submit" type="submit" onclick="setPID(4277)" value="Find hotels"/> </div>
</div>
</form>
</div>
<div id="ptptFlights" class="ptptContent">
<form class="FLIGHT_FORM_META" id="FLIGHT_FORM_META" name="AirfareAvailabilityComparisonForm" method="GET" action="/CheapFlights">
<input type="hidden" name="roundtrip" value="yes"/>
<fieldset class="flightDetails">
<div class="fldst">
<div>
<input type="hidden" id="metaFlightFromCode" name="Orig" value="ABE"/>
<input type="text" id="metaFlightFrom" class="text haltIfEmpty flightTypeAhead" value="Allentown, PA - Lehigh Valley International Airport (ABE)" autocomplete="off" tabindex="1" onfocus="ta.call(\'ta.widgets.typeahead.factory.flights\',event,this,\'AIRPORT\',\'ta.widgets.typeahead.events.homeFlightsOnSelect\',{minLength:3,className: \'autocompleter-choices flights\',selectOnBlur: true});HomeFFM.hideCalendar();this.select()"/>
</div>
<div class="dates wrap">
<span id="metaCheckInSpan" class="cal first">
<input type="hidden" class="day" name="leaveday" id="leaveDay" value="7"/>
<input type="hidden" class="month" name="leavemonth" id="leaveMonth" value="07/2012"/>
<input class="text" id="checkIn" type="text" value="7/7/2012" tabindex="3" onfocus="ta.overlays.createPairedCalendar(event, this, {allowSameDay:true});"/>
</span>
<select id="leaveTime" name="leavetime" tabindex="4" onfocus="HomeFFM.hideCalendar()">
<option value="anytime">Anytime</option> <option value="early">Early Morning</option> <option value="morning">Morning</option> <option value="afternoon">Afternoon</option> <option value="evening">Evening</option> <option value="night">Night</option> </select>
</div><!-- /dates -->
</div><!-- /fldst -->
<div class="arrowst">
<div class="frst">
<span class="flightArrow"><img src="http://c1.tacdn.com/img2/home/flights_arrow.gif"/></span>
</div>
<div class="scnd">
<span class="flightArrow"><img src="http://c1.tacdn.com/img2/home/flights_arrow.gif"/></span>
</div>
</div><!-- /arrowst -->
<div class="fldst rhs">
<div>
<input type="hidden" id="metaFlightToCode" name="Dest" value=""/>
<input type="text" id="metaFlightTo" class="text haltIfEmpty flightTypeAhead focusClear" value="To" autocomplete="off" tabindex="2" onfocus="ta.call(\'ta.widgets.typeahead.factory.flights\',event,this,\'AIRPORT\',\'ta.widgets.typeahead.events.homeFlightsOnSelect\',{minLength:3,className: \'autocompleter-choices flights\',selectOnBlur: true});HomeFFM.hideCalendar();this.select(); return ta.call(\'ta.common.search.clearOnFocus\',event);"/>
</div>
<div class="dates wrap">
<span id="metaCheckOutSpan" class="cal">
<input type="hidden" class="day" name="retday" id="retDay" value="14"/>
<input type="hidden" class="month" name="retmonth" id="retMonth" value="07/2012"/>
<input class="text" id="checkOut" type="text" value="7/14/2012" tabindex="5" onfocus="ta.overlays.createPairedCalendar(event, this, {allowSameDay:true});"/>
</span>
<select id="retTime" name="rettime" tabindex="6" onfocus="HomeFFM.hideCalendar()">
<option value="anytime">Anytime</option> <option value="early">Early Morning</option> <option value="morning">Morning</option> <option value="afternoon">Afternoon</option> <option value="evening">Evening</option> <option value="night">Night</option> </select>
</div><!-- /dates -->
</div><!-- /fldst -->
<div class="options">
<select class="select" name="adults" id="fadults" onfocus="HomeFFM.hideCalendar()">
<option value="1" selected="selected">1 traveler</option> <option value="2">2 travelers</option> <option value="3">3 travelers</option>
<option value="4">4 travelers</option>
<option value="5">5 travelers</option>
<option value="6">6 travelers</option>
</select>
<span>
<input id="nonstopOnly" class="checkbox alt" type="checkbox" name="nonstop" onfocus="HomeFFM.hideCalendar()"/>
<label for="nonstopOnly">Prefer nonstop</label> </span>
</div>
<div>
<div class="button ylw lrg">
<input class="submit" type="submit" value="Find flights" onclick="setPID(4278); $(\'FLIGHT_FORM_META\').action=\'/CheapFlights\'"/> </div>
<span class="moreOptions">
<a id=flights-more rel="nofollow" href="/Flights" onclick="HomeFFM.odPairButton(this);setPID(4829)">MORE OPTIONS</a> &raquo; (<a id=flights-oneway rel="nofollow" href="/Flights" onclick="HomeFFM.odPairButton(this);setPID(4830)">One-way</a>, <a id=flights-multicity rel="nofollow" href="/Flights" onclick="HomeFFM.odPairButton(this);setPID(4831)">multi-city</a>, etc).
</span>
</div>
</fieldset>
</form>
</div>
<div id="ptptRestaurants" class="ptptContent"></div>
<div id="ptptVRs" class="ptptContent"></div>
<div id="ptptThingsToDo" class="ptptContent"></div>
</div><!--/ ptptContainerBody-->
</div><!--/ perfecttripRD-->
</div><!--/ perfecttripFeaturePromo-->
<div class="gradient_gry">&nbsp;</div>
<div class="sidebar">
<div class="ad iab_medRecStrict">
<div id="ad300X250" class="adInner"><!-- Ad tags: doubleclick
domain=ad.doubleclick.net
site=ta.ta.com.s
zone=homepage
PageType=Home
pool=B
pos=top
rd=com
sz=300X250
tile=1
u=Home|B|-NOT-DEFINED-|-NOT-DEFINED-|top|-NOT-DEFINED-
ord=92256795
area=Home

-->
<div class="adServer ">
<div class="details" id="adiframe1" style="display: none">
<script> var adiframe1 = "ad.doubleclick.net+ta.ta.com.s+homepage+250+300+Home+false+PageType=Home;pool=B;pos=top;rd=com;sz=300X250;tile=1;u=Home%7CB%7C-NOT-DEFINED-%7C-NOT-DEFINED-%7Ctop%7C-NOT-DEFINED-;ord=92256795;abr=!webtv"; adpHtml = "adp/adp-v3515065965b.html"
</script>
</div>
<noscript>
<!-- for non JavaScript browsers and Netscape 2.x -->
<a href="http://ad.doubleclick.net/jump/ta.ta.com.s/homepage;PageType=Home;pool=B;pos=top;rd=com;sz=300X250;tile=1;u=Home%7CB%7C-NOT-DEFINED-%7C-NOT-DEFINED-%7Ctop%7C-NOT-DEFINED-;ord=92256795?" rel="nofollow">
<img src="http://ad.doubleclick.net/ad/ta.ta.com.s/homepage;PageType=Home;pool=B;pos=top;rd=com;sz=300X250;tile=1;u=Home%7CB%7C-NOT-DEFINED-%7C-NOT-DEFINED-%7Ctop%7C-NOT-DEFINED-;ord=92256795?" width="300" height="250" border="0">
</a>
</noscript>
</div> </div>
</div>
<div class="ad iab_medRec">
<div id="ad300X250-bottom" class="adInner"><!-- Ad tags: doubleclick
domain=ad.doubleclick.net
site=ta.ta.com.s
zone=homepage
PageType=Home
pool=B
pos=bottom
rd=com
sz=300X250
tile=2
u=Home|B|-NOT-DEFINED-|-NOT-DEFINED-|bottom|-NOT-DEFINED-
ord=92256795
area=Home

-->
<div class="adServer ">
<div class="details" id="adiframe2" style="display: none">
<script> var adiframe2 = "ad.doubleclick.net+ta.ta.com.s+homepage+250+300+Home+false+PageType=Home;pool=B;pos=bottom;rd=com;sz=300X250;tile=2;u=Home%7CB%7C-NOT-DEFINED-%7C-NOT-DEFINED-%7Cbottom%7C-NOT-DEFINED-;ord=92256795;abr=!webtv"; adpHtml = "adp/adp-v3515065965b.html"
</script>
</div>
<noscript>
<!-- for non JavaScript browsers and Netscape 2.x -->
<a href="http://ad.doubleclick.net/jump/ta.ta.com.s/homepage;PageType=Home;pool=B;pos=bottom;rd=com;sz=300X250;tile=2;u=Home%7CB%7C-NOT-DEFINED-%7C-NOT-DEFINED-%7Cbottom%7C-NOT-DEFINED-;ord=92256795?" rel="nofollow">
<img src="http://ad.doubleclick.net/ad/ta.ta.com.s/homepage;PageType=Home;pool=B;pos=bottom;rd=com;sz=300X250;tile=2;u=Home%7CB%7C-NOT-DEFINED-%7C-NOT-DEFINED-%7Cbottom%7C-NOT-DEFINED-;ord=92256795?" width="300" height="250" border="0">
</a>
</noscript>
</div> </div>
</div>
<div class="sidebaritem">
<h2>Tips for your next vacation</h2>
<div class="subheader">
<img id=\'lazyload_1671094719_0\' height=\'78\' alt=\'Subscribe to our free weekly TripWatch newsletter!\' width=\'94\'/>
<h3>Subscribe to our free weekly TripWatch newsletter!</h3> </div>
<p>Get the <b>latest deals, reviews & articles</b>. Tailored for the destinations you choose.</p>
<form action="/twsubscriptions" method="get">
<fieldset>
<input type="hidden" name="subSrc" value="twhomepage"/>
<input type="hidden" name="returnTo" value="__2F__"/>
<input type="hidden" name="from" value="twhomepage"/>
<input type="hidden" name="pid" value="431"/>
<input type="hidden" name="geo" value=""/>
<input class="txt focusClear" type="text" name="email" value="Enter your email" onfocus="return ta.call(\'ta.common.search.clearOnFocus\',event);"/> <input class="submit sprite-gradient1x27_gry" type="submit" name="sub-tw" value="Sign up"/> </fieldset>
</form>
</div>
<div class="sidebaritem lastitem">
<h2>Follow us</h2>
<div class="logolink">
<a href="/ShowUrl-a_partnerKey.1-a_url.http%253A__5F____5F__2F__5F____5F____5F____5F__2F__5F____5F__www__5F____5F__2E__5F____5F__facebook__5F____5F__2E__5F____5F__com__5F____5F__2F__5F____5F__TripAdvisor-a_urlKey.15090f72418302936-p15194.html" target="_blank" rel="nofollow">
<img id=\'lazyload_1671094719_1\' height=\'30\' alt=\'Follow us on Facebook\' width=\'30\'/></a>
<a href="/ShowUrl-a_partnerKey.1-a_url.http%253A__5F____5F__2F__5F____5F____5F____5F__2F__5F____5F__www__5F____5F__2E__5F____5F__facebook__5F____5F__2E__5F____5F__com__5F____5F__2F__5F____5F__TripAdvisor-a_urlKey.15090f72418302936-p15194.html" target="_blank" rel="nofollow">
Follow us on Facebook
</a>
</div>
<div class="logolink">
<a href="/ShowUrl-a_partnerKey.1-a_url.http%253A__5F____5F__2F__5F____5F____5F____5F__2F__5F____5F__twitter__5F____5F__2E__5F____5F__com__5F____5F__2F__5F____5F__%2523%2521__5F____5F__2F__5F____5F__tripadvisor-a_urlKey.70bd24f31acfae6ea-p15195.html" target="_blank" rel="nofollow">
<img id=\'lazyload_1671094719_2\' height=\'30\' alt=\'Follow us on Twitter\' width=\'30\'/></a>
<a href="/ShowUrl-a_partnerKey.1-a_url.http%253A__5F____5F__2F__5F____5F____5F____5F__2F__5F____5F__twitter__5F____5F__2E__5F____5F__com__5F____5F__2F__5F____5F__%2523%2521__5F____5F__2F__5F____5F__tripadvisor-a_urlKey.70bd24f31acfae6ea-p15195.html" target="_blank" rel="nofollow">
Follow us on Twitter
</a>
</div>
</div>
</div><!--/ sidebar-->
<div class="balance">
<div id="MEM_DASH"></div>
<div id="HOME_FRIEND_STRIP_PLACEHOLDER"></div>
<div id="LANDER_ACTIVITY_PLACEHOLDER"></div>
<div id="GEO_MODULE_CONTAINER"></div>
<div class="carousel">
<div class="carouselTitle">Traveler photos from around the world</div>
<div id="shiftLeft" onclick="shiftLeft(this);"><img id=\'lazyload_1671094719_3\' height=\'27\' alt=\'\' width=\'8\'/></div>
<div id="shiftRight" class="hasMore" onclick="shiftRight(this);"><img id=\'lazyload_1671094719_4\' height=\'27\' alt=\'\' width=\'8\'/></div>
<div class="images">
<div class="pane active">
<span class="image">
<a id="photo_25118956" class="objLrg u_/LocationPhotoDirectLink-g291976-i25118956-Dangriga_Stann_Creek.html#25118956" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_5\' height=\'187\' style=\'clip: rect(0px 218px 187px 31px); margin-left: -31px;\' alt=\'Coco Plum Island Resort, Belize\' width=\'250\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_6\' height=\'40\' alt=\'roblahblah\' width=\'40\'/> </span>
<span class="location">Coco Plum Island...</span><br/>
<span class="attribution">by roblahblah</span>
</span>
</span><span class="image">
<a id="photo_26257488" class="objLrg u_/LocationPhotoDirectLink-g294331-i26257488-Fiji.html#26257488" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_7\' height=\'187\' style=\'clip: rect(0px 234px 187px 47px); margin-left: -47px;\' alt=\'Fiji\' width=\'281\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_8\' height=\'40\' alt=\'Serand24\' width=\'40\'/> </span>
<span class="location">Fiji</span><br/>
<span class="attribution">by Serand24</span>
</span>
</span><span class="image">
<a id="photo_29615406" class="objLrg u_/LocationPhotoDirectLink-g34636-i29615406-Siesta_Key_Florida.html#29615406" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_9\' height=\'187\' style=\'clip: rect(0px 234px 187px 47px); margin-left: -47px;\' alt=\'Siesta Key, Florida\' width=\'281\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_10\' height=\'40\' alt=\'pedrothelion77\' width=\'40\'/> </span>
<span class="location">Siesta Key, Florida</span><br/>
<span class="attribution">by pedrotheli...</span>
</span>
</span> </div>
<div class="pane">
<span class="image">
<a id="photo_24462771" class="objLrg u_/LocationPhotoDirectLink-g33377-i24462771-Crested_Butte_Colorado.html#24462771" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_11\' height=\'187\' style=\'clip: rect(0px 218px 187px 31px); margin-left: -31px;\' alt=\'Crested Butte, Colorado\' width=\'250\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_12\' height=\'40\' alt=\'a Facebook Member\' width=\'40\'/> </span>
<span class="location">Crested Butte, Colorado</span><br/>
<span class="attribution">by a Facebook...</span>
</span>
</span><span class="image">
<a id="photo_17339197" class="objLrg u_/LocationPhotoDirectLink-g187179-i17339197-Normandy.html#17339197" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_13\' height=\'187\' style=\'clip: rect(0px 218px 187px 31px); margin-left: -31px;\' alt=\'Normandy, France\' width=\'250\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_14\' height=\'40\' alt=\'4956\' width=\'40\'/> </span>
<span class="location">Normandy, France</span><br/>
<span class="attribution">by 4956</span>
</span>
</span><span class="image">
<a id="photo_36865270" class="objLrg u_/LocationPhotoDirectLink-g55525-i36865270-Brenham_Texas.html#36865270" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_15\' height=\'187\' style=\'clip: rect(0px 250px 187px 63px); margin-left: -63px;\' alt=\'Brenham, Texas\' width=\'313\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_16\' height=\'40\' alt=\'VisitBrenhamTX T\' width=\'40\'/> </span>
<span class="location">Brenham, Texas</span><br/>
<span class="attribution">by VisitBrenh...</span>
</span>
</span> </div>
<div class="pane">
<span class="image">
<a id="photo_35680903" class="objLrg u_/LocationPhotoDirectLink-g551611-i35680903-St_Brelade_Jersey_Channel_Islands.html#35680903" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_17\' height=\'187\' style=\'clip: rect(0px 259px 187px 72px); margin-left: -72px;\' alt=\'Corbiere Lighthouse (La Corbiere), United Kingdom\' width=\'332\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_18\' height=\'40\' alt=\'Annietj\' width=\'40\'/> </span>
<span class="location">Corbiere Lighthouse (La...</span><br/>
<span class="attribution">by Annietj</span>
</span>
</span><span class="image">
<a id="photo_17148709" class="objLrg u_/LocationPhotoDirectLink-g499311-i17148709-Cavendish_Prince_Edward_Island.html#17148709" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_19\' height=\'187\' style=\'clip: rect(0px 218px 187px 31px); margin-left: -31px;\' alt=\'Kindred Spirits Country Inn & Cottages, Canada\' width=\'250\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_20\' height=\'40\' alt=\'bird2372\' width=\'40\'/> </span>
<span class="location">Kindred Spirits Country...</span><br/>
<span class="attribution">by bird2372</span>
</span>
</span><span class="image">
<a id="photo_20689971" class="objLrg u_/LocationPhotoDirectLink-g51992-i20689971-Newport_Oregon.html#20689971" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_21\' height=\'187\' style=\'clip: rect(0px 234px 187px 47px); margin-left: -47px;\' alt=\'Newport, Oregon\' width=\'281\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_22\' height=\'40\' alt=\'KennPhoto\' width=\'40\'/> </span>
<span class="location">Newport, Oregon</span><br/>
<span class="attribution">by KennPhoto</span>
</span>
</span> </div>
<div class="pane">
<span class="image">
<a id="photo_29520716" class="objLrg u_/LocationPhotoDirectLink-g60958-i29520716-Santa_Fe_New_Mexico.html#29520716" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_23\' height=\'187\' style=\'clip: rect(0px 221px 187px 34px); margin-left: -34px;\' alt=\'Santa Fe, New Mexico\' width=\'255\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_24\' height=\'40\' alt=\'SantaFeTourism\' width=\'40\'/> </span>
<span class="location">Santa Fe, New Mexico</span><br/>
<span class="attribution">by SantaFeTou...</span>
</span>
</span><span class="image">
<a id="photo_25518884" class="objLrg u_/LocationPhotoDirectLink-g189413-i25518884-Crete.html#25518884" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_25\' height=\'281\' style=\'clip: rect(47px 187px 234px 0px); margin-top: -47px;\' alt=\'Crete, Greece\' width=\'187\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_26\' height=\'40\' alt=\'Guliverstravels\' width=\'40\'/> </span>
<span class="location">Crete, Greece</span><br/>
<span class="attribution">by Guliverstr...</span>
</span>
</span><span class="image">
<a id="photo_25097042" class="objLrg u_/LocationPhotoDirectLink-g293734-i25097042-Marrakech_Marrakech_Tensift_El_Haouz_Region.html#25097042" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_27\' height=\'187\' style=\'clip: rect(0px 239px 187px 52px); margin-left: -52px;\' alt=\'Marrakech, Morocco\' width=\'291\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_28\' height=\'40\' alt=\'dieselbloke\' width=\'40\'/> </span>
<span class="location">Marrakech, Morocco</span><br/>
<span class="attribution">by dieselblok...</span>
</span>
</span> </div>
<div class="pane">
<span class="image">
<a id="photo_1589752" class="objLrg u_/LocationPhotoDirectLink-g293751-i1589752-Serengeti_National_Park_Serengeti_Region.html#1589752" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_29\' height=\'187\' style=\'clip: rect(0px 251px 187px 64px); margin-left: -64px;\' alt=\'Serengeti National Park, Tanzania\' width=\'315\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_30\' height=\'40\' alt=\'jimmivi\' width=\'40\'/> </span>
<span class="location">Serengeti National...</span><br/>
<span class="attribution">by jimmivi</span>
</span>
</span><span class="image">
<a id="photo_26823306" class="objLrg u_/LocationPhotoDirectLink-g294077-i26823306-Guyana.html#26823306" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_31\' height=\'187\' style=\'clip: rect(0px 238px 187px 51px); margin-left: -51px;\' alt=\'Guyana\' width=\'290\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_32\' height=\'40\' alt=\'MRMinSF\' width=\'40\'/> </span>
<span class="location">Guyana</span><br/>
<span class="attribution">by MRMinSF</span>
</span>
</span><span class="image">
<a id="photo_29399938" class="objLrg u_/LocationPhotoDirectLink-g60999-i29399938-Yellowstone_National_Park_Wyoming.html#29399938" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_33\' height=\'187\' style=\'clip: rect(0px 234px 187px 47px); margin-left: -47px;\' alt=\'Yellowstone National Park, Wyoming\' width=\'281\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_34\' height=\'40\' alt=\'kthorlakson\' width=\'40\'/> </span>
<span class="location">Yellowstone National...</span><br/>
<span class="attribution">by kthorlakso...</span>
</span>
</span> </div>
<div class="pane">
<span class="image">
<a id="photo_28800716" class="objLrg u_/LocationPhotoDirectLink-g150813-i28800716-Tulum_Yucatan_Peninsula.html#28800716" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_35\' height=\'187\' style=\'clip: rect(0px 234px 187px 47px); margin-left: -47px;\' alt=\'Tulum, Mexico\' width=\'280\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_36\' height=\'40\' alt=\'PaolaFung\' width=\'40\'/> </span>
<span class="location">Tulum, Mexico</span><br/>
<span class="attribution">by PaolaFung</span>
</span>
</span><span class="image">
<a id="photo_32135607" class="objLrg u_/LocationPhotoDirectLink-g608703-i32135607-Brac_Island_Split_Dalmatia_County_Dalmatia.html#32135607" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_37\' height=\'187\' style=\'clip: rect(0px 218px 187px 31px); margin-left: -31px;\' alt=\'Brac Island, Croatia\' width=\'250\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_38\' height=\'40\' alt=\'Madras47\' width=\'40\'/> </span>
<span class="location">Brac Island, Croatia</span><br/>
<span class="attribution">by Madras47</span>
</span>
</span><span class="image">
<a id="photo_19746313" class="objLrg u_/LocationPhotoDirectLink-g240329-i19746313-Big_Sur_California.html#19746313" onclick="setPID(15196); return ta.call(\'ta.overlays.Factory.photosLB\', event);" rel="nofollow"><img id=\'lazyload_1671094719_39\' height=\'187\' style=\'clip: rect(0px 218px 187px 31px); margin-left: -31px;\' alt=\'Big Sur, California\' width=\'250\'/></a>
<span class="shadow"></span>
<span class="caption">
<span class="avatar"> <img id=\'lazyload_1671094719_40\' height=\'40\' alt=\'amyloutoo\' width=\'40\'/> </span>
<span class="location">Big Sur, California</span><br/>
<span class="attribution">by amyloutoo</span>
</span>
</span> </div>
</div>
</div>
<div class="spotlightDest">
<div class="interior">
<div class="spotlightHeader">Spotlight Destination</div>
<div class="wrap">
<div class="photo">
<img id=\'lazyload_1671094719_41\' alt=\'Kelowna\'/>
</div>
<div class="spotlightText">
<b>Kelowna:</b> Sun-drenched vineyards, internationally-awarded wines, fresh seasonal harvest in wine country cuisine, photogenic lake views and extraordinary golf are signatures of Kelowna, the nucleus of BC&#8217;s Okanagan Valley. Wine tour, golf, mountain bike or lounge on the beach &#8211; no matter what your speed, Kelowna is Ripe with Surprises.
</div>
</div>
<div class="spotlightFooter">
<span class="sdLeft">Description provided by:
<a rel="nofollow" href="/ShowUrl-a_partnerKey.1-a_url.http%253A%252F%252Fwww__2E__tourismkelowna__2E__com%252F-a_urlKey.083f33fc7242b105a.html" target="_blank">Tourism Kelowna</a></span>
<span class="sdRight">
<a href="/Tourism-g154933-Kelowna_Okanagan_Valley_British_Columbia-Vacations.html">Read more about Kelowna&#xa0;&#xbb;</a>
</span>
</div>
</div>
</div>
<div class="boxhp quickLinks">
<div class="header">Quick links</div>
<div class="col">
<ul>
<li class="section"><b>Share your experiences</b> <ul>
<li class="sprite-middot"><span class="fkLnk hvrIE6" onclick="ta.util.ASDF.asdf(\'Lqd\',436)">Write a review</span></li> <li class="sprite-middot"><span class="fkLnk hvrIE6" onclick="ta.util.ASDF.asdf(\'Lqdhp22iEI\',0)">Get help with your reviews and ratings</span></li> <li class="sprite-middot"><span class="fkLnk hvrIE6" onclick="ta.util.ASDF.asdf(\'LqniEpa5iaV\',0)">Ask a question or browse the forums</span></li> <li class="sprite-middot"><span class="fkLnk hvrIE6" onclick="ta.util.ASDF.asdf(\'Lzu5iaV\',437)">Write a Traveler Article</span></li> <li class="sprite-middot"><span class="fkLnk hvrIE6" onclick="ta.util.ASDF.asdf(\'LZVuzziRStI\',438)">Create a Trip List</span></li> </ul>
</li>
<li class="section"><b>Member preferences</b> <ul>
<li class="sprite-middot"><span class="fkLnk hvrIE6" onclick="ta.util.ASDF.asdf(\'LqS\',439)">Update your profile or subscriptions</span></li> </ul>
</li>
<li class="section"><b>Talk to us</b> <ul>
<li class="sprite-middot"><span class="fkLnk hvrIE6" onclick="ta.util.ASDF.asdf(\'Lqo\',0)">Send feedback or report a problem</span></li> </ul>
</li>
<li class="section"><b>Fun travel stories</b> <ul>
<li class="sprite-middot"><a href="http://tripwow.tripadvisor.com/">Make a slideshow</a> from your travel photos</li>
<li class="sprite-middot"><span class="fkLnk hvrIE6" onclick="ta.util.ASDF.asdf(\'LrlxXzzJaV\',769)">Play Traveler IQ Game</span></li>
<li class="sprite-middot"><span class="fkLnk hvrIE6" onclick="ta.util.ASDF.asdfPopup(\'PzSYuiEM2EVtt8L\',0)">Read the TripAdvisor Blog</span></li> </ul>
</li>
<li class="section"><b>For owners</b> <ul>
<li class="sprite-middot"><a href="/BusinessListings">Learn about Business Listings</a></li>
<li class="sprite-middot"><a href="/Owners">Visit your Management Center</a></li> </ul>
</li>
<li class="section"><b>Advertise with us</b> <ul>
<li class="sprite-middot"><a href="/MediaKit">Find out about advertising or partnering with us</a></li> </ul>
</li>
</ul>
</div><!--/ col-->
<div class="col rcol">
<ul>
<li class="section"><b>Browse by trip type</b> <ul>
<li class="sprite-middot"><span class="fkLnk hvrIE6" onclick="ta.util.ASDF.asdf(\'LqhWyUWnvWxdiEcMB\',1737)">Luxury travel</span></li>
<li class="sprite-middot"><span class="fkLnk hvrIE6" onclick="ta.util.ASDF.asdf(\'LqhWyUWnKWxdiEcMB\',1738)">Family travel</span></li>
</ul>
</li>
<li class="section"><b>Partner Sites</b> <ul>
<li class="sprite-middot">Compare <a href="http://www.bookingbuddy.com/" target="_blank">cheap flights</a> on Booking Buddy</li>
<li class="sprite-middot">Read <a href="http://www.cruisecritic.com/" target="_blank">cruise reviews</a> on Cruise Critic</li>
<li class="sprite-middot">Download <a href="http://www.everytrail.com" target="_blank">mobile travel guides</a> at EveryTrail</li>
<li class="sprite-middot">Read <a href="http://www.smartertravel.com/travel-guides/" target="_blank">travel guides</a> at SmarterTravel</li>
<li class="sprite-middot">Get <a href="http://www.seatguru.com/" target="_blank">airline seating charts</a> on Seat Guru</li>
<li class="sprite-middot">Find <a href="http://www.airfarewatchdog.com/" target="_blank">airfare deals</a> at Airfarewatchdog</li>
<li class="sprite-middot">Share <a href="http://www.virtualtourist.com/" target="_blank">travel tips</a> at VirtualTourist</li>
<li class="sprite-middot">Create a <a href="http://www.travelpod.com/" target="_blank">travel blog</a> on TravelPod</li>
<li class="sprite-middot">Find <a href="http://www.flipkey.com/" target="_blank">vacation rentals</a> on FlipKey</li>
<li class="sprite-middot">Find <a href="http://www.holidaylettings.co.uk/" target="_blank">holiday rentals</a> on Holiday Lettings</li>
<li class="sprite-middot">Plan a <a href="http://www.familyvacationcritic.com/" target="_blank">family vacation</a> on Family Vacation Critic</li>
</ul>
</li>
</ul>
</div><!--/ col-->
</div><!--/ boxhp.quickLinks-->
<div class="boxhp popDest popDestFirst">
<div class="header"><strong>Hotels in popular destinations:</strong></div>
<div class="paragraph">Whether you prefer worldwide hotel chains or cozy boutique hotels, you\'ll find real hotel reviews you can trust at TripAdvisor. Millions of travelers have shared their candid reviews of hotels, bed & breakfasts, inns, and more. Add your travel reviews and help travelers around the world plan and have a great trip.</div>
<div class="featured wrap">
<div class="tagline"><span class="header">United States & Canada</span></div>
<ul class="first">
<li class="sprite-middot"><a href="/Hotels-g29092-Anaheim_California-Hotels.html">Anaheim hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g147247-Aruba-Hotels.html">Aruba hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60742-Asheville_North_Carolina-Hotels.html">Asheville hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60898-Atlanta_Georgia-Hotels.html">Atlanta hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g29750-Atlantic_City_New_Jersey-Hotels.html">Atlantic City hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g30196-Austin_Texas-Hotels.html">Austin hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60811-Baltimore_Maryland-Hotels.html">Baltimore hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60745-Boston_Massachusetts-Hotels.html">Boston hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g44160-Branson_Missouri-Hotels.html">Branson hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60827-Brooklyn_New_York-Hotels.html">Brooklyn hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g54171-Charleston_South_Carolina-Hotels.html">Charleston hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g35805-Chicago_Illinois-Hotels.html">Chicago hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34141-Clearwater_Florida-Hotels.html">Clearwater hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g55711-Dallas_Texas-Hotels.html">Dallas hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34172-Daytona_Beach_Florida-Hotels.html">Daytona Beach hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g33388-Denver_Colorado-Hotels.html">Denver hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34182-Destin_Florida-Hotels.html">Destin hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34227-Fort_Lauderdale_Florida-Hotels.html">Fort Lauderdale hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g55879-Galveston_Galveston_Island_Texas-Hotels.html">Galveston hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60842-Gatlinburg_Tennessee-Hotels.html">Gatlinburg hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g28932-Hawaii-Hotels.html">Hawaii hotels</a></li> </ul>
<ul class="evenCol">
<li class="sprite-middot"><a href="/Hotels-g54273-Hilton_Head_South_Carolina-Hotels.html">Hilton Head hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60982-Honolulu_Oahu_Hawaii-Hotels.html">Honolulu hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g29218-Kauai_Hawaii-Hotels.html">Kauai hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34344-Key_Largo_Florida_Keys_Florida-Hotels.html">Key Largo hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34345-Key_West_Florida_Keys_Florida-Hotels.html">Key West hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34352-Kissimmee_Florida-Hotels.html">Kissimmee hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g32588-Laguna_Beach_California-Hotels.html">Laguna Beach hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g32578-La_Jolla_California-Hotels.html">La Jolla hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g45963-Las_Vegas_Nevada-Hotels.html">Las Vegas hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g32655-Los_Angeles_California-Hotels.html">Los Angeles hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g29220-Maui_Hawaii-Hotels.html">Maui hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34438-Miami_Florida-Hotels.html">Miami hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34439-Miami_Beach_Florida-Hotels.html">Miami Beach hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g32737-Monterey_Monterey_Peninsula_California-Hotels.html">Monterey hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g155032-Montreal_Quebec-Hotels.html">Montreal hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g54359-Myrtle_Beach_South_Carolina-Hotels.html">Myrtle Beach hotels</a></li> <li class="sprite-middot"><a href="/myrtle-beach-vacation-rentals.html">Myrtle Beach vacation rentals</a></li> <li class="sprite-middot"><a href="/Hotels-g32766-Napa_Napa_Valley_California-Hotels.html">Napa hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g580460-Napa_Valley_California-Hotels.html">Napa Valley hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g55229-Nashville_Tennessee-Hotels.html">Nashville hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60864-New_Orleans_Louisiana-Hotels.html">New Orleans hotels</a></li> </ul>
<ul>
<li class="sprite-middot"><a href="/Hotels-g60978-Newport_Rhode_Island-Hotels.html">Newport hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g28953-New_York-Hotels.html">New York hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60763-New_York_City_New_York-Hotels.html">New York City hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g48261-Niagara_Falls_New_York-Hotels.html">Niagara Falls hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g54371-North_Myrtle_Beach_South_Carolina-Hotels.html">North Myrtle Beach hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g29222-Oahu_Hawaii-Hotels.html">Oahu hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g41298-Ocean_City_Maryland-Hotels.html">Ocean City hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34515-Orlando_Florida-Hotels.html">Orlando hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g616326-Outer_Banks_North_Carolina-Hotels.html">Outer Banks hotels</a></li> <li class="sprite-middot"><a href="/outer-banks-vacation-rentals.html">Outer Banks vacation rentals</a></li> <li class="sprite-middot"><a href="/Hotels-g32847-Palm_Springs_California-Hotels.html">Palm Springs hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34543-Panama_City_Beach_Florida-Hotels.html">Panama City Beach hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60795-Philadelphia_Pennsylvania-Hotels.html">Philadelphia hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g31310-Phoenix_Arizona-Hotels.html">Phoenix hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g55270-Pigeon_Forge_Tennessee-Hotels.html">Pigeon Forge hotels</a></li> <li class="sprite-middot"><a href="/VacationRentals-g55270-Reviews-Pigeon_Forge_Tennessee-Vacation_Rentals.html">Pigeon Forge vacation rentals</a></li> <li class="sprite-middot"><a href="/Hotels-g32894-Pismo_Beach_California-Hotels.html">Pismo Beach hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g52024-Portland_Oregon-Hotels.html">Portland hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g274707-Prague_Bohemia-Hotels.html">Prague hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g45992-Reno_Nevada-Hotels.html">Reno hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60956-San_Antonio_Texas-Hotels.html">San Antonio hotels</a></li> </ul>
<ul class="evenCol">
<li class="sprite-middot"><a href="/Hotels-g60750-San_Diego_California-Hotels.html">San Diego hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60713-San_Francisco_California-Hotels.html">San Francisco hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34616-Sanibel_Island_Florida-Hotels.html">Sanibel Island hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g33045-Santa_Barbara_California-Hotels.html">Santa Barbara hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g33048-Santa_Cruz_California-Hotels.html">Santa Cruz hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60958-Santa_Fe_New_Mexico-Hotels.html">Santa Fe hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g33052-Santa_Monica_California-Hotels.html">Santa Monica hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60814-Savannah_Georgia-Hotels.html">Savannah hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g31350-Scottsdale_Arizona-Hotels.html">Scottsdale hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g60878-Seattle_Washington-Hotels.html">Seattle hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g31352-Sedona_Arizona-Hotels.html">Sedona hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g34636-Siesta_Key_Florida-Hotels.html">Siesta Key hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g56691-South_Padre_Island_Texas-Hotels.html">South Padre Island hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g155019-Toronto_Ontario-Hotels.html">Toronto hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g42758-Traverse_City_Grand_Traverse_County_Michigan-Hotels.html">Traverse City hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g154943-Vancouver_British_Columbia-Hotels.html">Vancouver hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g58277-Virginia_Beach_Virginia-Hotels.html">Virginia Beach hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g28970-Washington_DC_District_of_Columbia-Hotels.html">Washington DC hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g58313-Williamsburg_Virginia-Hotels.html">Williamsburg hotels</a></li> </ul>
</div><!--/ featured-->
<div class="featured wrap">
<div class="tagline"><span class="header">Europe</span></div>
<ul class="first">
<li class="sprite-middot"><a href="/Hotels-g188590-Amsterdam_North_Holland_Province-Hotels.html">Amsterdam hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g187497-Barcelona_Catalonia-Hotels.html">Barcelona hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g187323-Berlin-Hotels.html">Berlin hotels</a></li> </ul>
<ul class="evenCol">
<li class="sprite-middot"><a href="/Hotels-g186605-Dublin_County_Dublin-Hotels.html">Dublin hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g187895-Florence_Tuscany-Hotels.html">Florence hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g293974-Istanbul-Hotels.html">Istanbul hotels</a></li> </ul>
<ul>
<li class="sprite-middot"><a href="/Hotels-g186338-London_England-Hotels.html">London hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g187514-Madrid-Hotels.html">Madrid hotels</a></li> <li class="sprite-middot"><a href="/Hotels-g187309-Munich_Bavaria-Hotels.html">Munich hotels</a></l
fkiller commented 12 years ago

Here is what I get. Sorry for the mess output.

aredridel commented 12 years ago

No worries -- see that it parses an empty document twice before? It's not actually being reset after that, thanks to how Zombie starts up JSDOM. I'm looking at the best way to fix it.

aredridel commented 12 years ago

A minimal and zombie-free test case:

var jsdom = require('jsdom');
var html5 = require('html5');

var doc = jsdom.jsdom(null, jsdom.dom.level3.html, {parser: html5.HTML5});

doc.open();
doc.write('<!DOCTYPE HTML SYSTEM "BOOM"><html foo=bar>');
aredridel commented 12 years ago

we'll see if Elijah accepts this upstream in jsdom.

aredridel commented 12 years ago

Can you try the latest master?

fkiller commented 12 years ago

I'd been using your fix before it has been updated. Thank you so much.