对象不支持“split”属性或方法

初学者问题:为什么location.split("?")不支持此方法?
var   UrlParts=location.split( "? "); 
跳出错误:对象不支持此属性和方法, 
window.localhost不是返回一个URL字符串么?字符串不是支持split么?为什么说不支持?

------解决方案--------------------------------------------------------
location.href.split 
location.toString().split 
------解决方案--------------------------------------------------------
<script language=javascript> 
alert(location.href.toString().split( "? ")) 
</script>
posted @ 2012-09-28 16:23  y0umer  阅读(457)  评论(0编辑  收藏  举报