Get WOEID from city name?

Okay I got to know from your comments what exactly you want

You have a place name and you want to get the WOEID of that place name using javascript ajax calls

The url to get that is not defined any where you have to use GeoPlanet service to resolve a place to a WOEID

http://where.yahooapis.com/v1/places.q('Place name')?appid=[yourappidhere] 

OR you have to use Direct YQL some what like this ( use percent encoding in the url for your city name ) appropriately and try doing an ajax call to this

http://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20geo.places%20where%20text%3D%22Place%20name%22&format=xml