jquery Programming Glossary: window.location.origin
twitter bootstrap typeahead (method 'toLowerCase' of undefined) http://stackoverflow.com/questions/11235644/twitter-bootstrap-typeahead-method-tolowercase-of-undefined the same error. My code currently is as follows '#manufacturer' .typeahead source function typeahead query .ajax url window.location.origin bows get_manufacturers.json type POST data dataType JSON async false success function results var manufacturers new Array.. group typeahead.process manufacturers property 'name' items 11 onselect function obj on the url field I added the window.location.origin to avoid any problems as already discussed on another question Also before I was using .each and then decided to use .map..
Get host name in JavaScript http://stackoverflow.com/questions/1368264/get-host-name-in-javascript you'll get sub.domain.com window.location.protocol you'll get http window.location.port you'll get 8080 or 80 window.location.origin you'll get http sub.domain.com Update about the .origin As the ref states browser compatibility for window.location.origin.. you'll get http sub.domain.com Update about the .origin As the ref states browser compatibility for window.location.origin is not clear. I've checked it in chrome and it returned http sub.domain.com port . Special thanks to @torazaburo for mentioning..
JavaScript/jQuery method to find base URL from a string http://stackoverflow.com/questions/1420881/javascript-jquery-method-to-find-base-url-from-a-string
|