javascript无法在bootstrap上运行 [英] javascript is not working on bootstrap

查看:77
本文介绍了javascript无法在bootstrap上运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



javascript无法使用bootstrap,



我的代码:



 <   script     type   =  text / javascript    language   =  javascript >  
function ConfirmOnDelete( INVCODE){
if(确认(你确定要删除吗?)== true){
window.location =del.aspx?INVCODE =+ INVCODE +&DOIFI =+ 1;
返回true;
}
其他
返回false;
}
< / script >





它不会将我重定向到del.aspx页面,JUST window.open正在运行,其他选项是不工作......比如window.location.href等。



Plzzz建议我,怎么办。





最好的问候,

解决方案

参考 - JavaScript中的Windows.location.href()和Window.open()方法 [ ^ ]。

Quote:

window .location.href 不是方法,它是一个告诉您浏览器当前URL位置的属性。将属性设置为不同的属性将重定向页面。



window.open()是一种方法,你可以将URL传递给您要在新窗口中打开的URL。例如:



window.location.href 例如:

 < span class =code-sdkkeyword> window 。 location  .href = '  http://www.google.com;  //  将带您进入Google。 



window.open()示例:

  window  .open(< span class =code-string>'  http://www.google.com');  //  这将在新窗口中打开Goog​​le。 



附加信息:

window.open()可以传递其他参数。请参阅: window.open教程 [ ^ ]


Hi guys,

javascript is not working on bootstrap,

my code:

<script type="text/javascript" language="javascript">
                             function ConfirmOnDelete(INVCODE) {
                                 if (confirm("Are you sure you want to Delete?") == true) {
                                     window.location = "del.aspx?INVCODE=" + INVCODE +"&DOIF=" + 1;
                                     return true;
                                 }
                                 else
                                     return false;
                             }
                            </script>



its not redirecting me to del.aspx page, JUST window.open is working, other options are not working...like window.location.href, etc.

Plzzz suggest me, what to do.


Best Regards,

解决方案

Refer - Window.location.href () and Window.open () methods in JavaScript[^].

Quote:

window.location.href is not a method, it's a property that will tell you the current URL location of the browser. Setting the property to something different will redirect the page.

window.open() is a method that you can pass a URL to that you want to open in a new window. For example:

window.location.href example:

window.location.href = 'http://www.google.com'; //Will take you to Google.


window.open() example:

window.open('http://www.google.com'); //This will open Google in a new window.


Additional Information:
window.open() can be passed additional parameters. See: window.open tutorial[^]


这篇关于javascript无法在bootstrap上运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆