`

window.location is not a function

阅读更多

html按钮button加超链接

<input type=button onclick="window.location.href('连接')"> 
 

 

在FF上面提示是:window.location is not a function ,在IE上面正常工作。

解决方法: 使用window.location不是window.location.href

分享到:
评论

相关推荐

    关于js中[removed].href,location.href,parent.location.href,top.location.href的用法与区别

    “[removed].href”、”location.href”是本页面跳转 “parent.location.href”是上一层页面跳转 “top.location.href”是最外层的页面跳转 举例说明: 如果A,B,C,D都是jsp,D是C的iframe,C是B的iframe,B是A的...

    window.navigate 与 [removed].href 的使用区别介绍

    &lt;a onclick="javascript:window.location.href='http://jb51.net/'"&gt;我们&lt;/a&gt; ``` 这种方式在点击链接时,会触发JavaScript代码,改变当前页面的URL并进行跳转。这种方法不仅在所有现代浏览器中都能正常工作,而且...

    107个常用javascript语句

    24.指定当前显示链接的位置:window.location.href="URL" 25.取出窗体中的所有表单的数量:document.forms.length 26.关闭文档的输出流:document.close(); 27.字符串追加连接符: = 28.创建一个文档元素:document....

    谷歌浏览器不支持showModalDialog模态对话框的解决方法

    `window.open`函数可以打开一个新的浏览器窗口或标签,通过设置参数,如"height", "width", "status", "toolbar", "menubar", 和 "location",可以定制新窗口的样式和行为,使其更接近模态对话框的效果。在给出的...

    javascript的propertyIsEnumerable()方法使用介绍

    代码如下: /* propertyIsEnumerable()是... */ function MyObject() { this.name = “我是实例的属性”; } var obj = new MyObject(); alert&#40;obj.propertyIsEnumerable(“name”&#41;);//true MyObject.prototype

    出现问题a is defined高手帮忙

    buttonZoomingHTML: 'Drag a region on the map', buttonZoomingStyle: {background: '#FF0'}, overlayRemoveTime: 6000, backButtonEnabled: false, stickyZoomEnabled: false, rightMouseZoomOutEnabled: ...

    数位板压力测试

    The definition is not lim¬ited to de¬vices that use a physical tablet. In fact, this specification can support de¬vices that combine rela¬tive and absolute pointing as well as purely relative ...

    FlexGraphics_V_1.79_D4-XE10.2_Downloadly.ir

    TFlexGrid is released, and a user's one is set). - ADD: In the class TFlexGrid added the properties HOffset and VOffset - contain grid offset relative to document's upper-left corner. - FIX: In the ...

    Making Games with Python & PyGame.pdf(with code)

    Who is this book for? ........................................................................................................................ i About This Book ..........................................

    jquery刷新页面和JS常用的函数

    window.location.reload(); ``` 此方法会重新加载当前页面。 **刷新父页面:** ```javascript parent.location.reload(); ``` 如果当前页面位于一个 `iframe` 内,则使用 `parent.location.reload()` 可以刷新父...

    JavaScript-js宝典笔学习记.txt

    console.log("x is not positive."); } ``` #### 15. 循环结构 `for([initial expression];[condition];[update expression]) { inside loop }` `for` 循环是一种常用的迭代结构,用于重复执行一段代码多次。 ```...

    108JAVASCRIPT语句.

    console.log("x is not positive"); } ``` ### 15. 循环语句 `for` 循环是一种常用的循环结构,用于重复执行一段代码。例如: ```javascript for (let i = 0; i ; i++) { console.log(i); } ``` ### 16. 循环...

    javascript中的小技巧

    let newText = document.createTextNode("This is a new paragraph."); newElement.appendChild(newText); document.body.appendChild(newElement); ``` #### 29. 获取特定元素 使用 `document.getElementById()` ...

    BURNINTEST--硬件检测工具

    - Corrected a Disk test bug where on rare occasions a verification error is incorrectly displayed. This is during the random seeking phase of the "Random data with random seeking" test mode and ...

    android 通过webview 取源码

    描述中提到的"Uncaught TypeError: undefined is not a function"是JavaScript中的一个常见错误,通常意味着尝试调用一个未定义的函数。在Webview上下文中,这可能是因为在4.4及更高版本的Webview中,一些API或者...

    javascript技巧

    20. **获取当前页面 URL**:`window.location.href` 属性可以获取或设置当前页面的 URL。例如: ```javascript console.log(window.location.href); ``` 21. **创建新的 DOM 节点**:可以使用 `document....

    编辑任意PDF文件

    This useful function is fast and easy for users looking for text within a document or an article. 3.Navigating with Bookmarks Navigating through bookmarks is an efficient way for users to link to ...

    JavaScript APIs HTML5

    - `window.postMessage()`: Sends a message to another window. - `window.addEventListener('message')`: Listens for incoming messages. Example usage: ```javascript // Sending a message window.post...

    js 函数大全--一些常用的就是函数

    } else { console.log("x is not greater than 10"); }`. 15. **循环结构**: - `for` 循环是最常用的迭代方式之一。 - 示例:`for (var i = 0; i ; i++) { console.log(i); }`. 16. **循环中断**: - `break` ...

    cordova-baiduLocation:cordova 百度定位插件

    使用的百度Android定位SDK 5.01在AndroidManifest.xml中的"com.baidu.lbsapi.API_KEY" 修改为自己申请的百度Key调用方式window.baiduLocation.startLocation(function (success) {alert&#40;success.latitude + "," ...

Global site tag (gtag.js) - Google Analytics