Click here to Skip to main content
15,896,437 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi guys,

javascript is not working on bootstrap,

my code:

XML
<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,
Posted

1 solution

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:
JavaScript
window.location.href = 'http://www.google.com'; //Will take you to Google.

window.open() example:
JavaScript
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[^]
 
Share this answer
 
Comments
abdul subhan mohammed 18-Jan-14 0:20am    
<script type="text/javascript" language="javascript">
function ConfirmOnDelete(ORDCODE) {
if (confirm("Are you SURE you want to Delete") == true) {
window.open("del.aspx?ORDCODE=" + ORDCODE + "&DOIF=" + 1);
return true;
}
else {
confirm("Info NOT yet Deleted!");
return false;
}
}

function updateCo(CONAME, COID) {
window.location.href = "updateCo.aspx?CONAME=" + CONAME + "&COID=" + COID;
}
</script>

still this code is not working....
Then there is an issue with the value of ORDCODE. Debug and check what is the value? I guess it is null or undefined.
abdul subhan mohammed 21-Jan-14 9:20am    
Hi Tadit Dash,
I have posted one query regarding bootstrap icon are not appearing on server after publishing web app in asp.net, if know, could plz help me. thnx
Ok, let me check. I have not worked on Bootstrap, but let me check. If I can help, then I will reply there.
abdul subhan mohammed 18-Jan-14 1:20am    
only window.open("del.aspx") is working, but other then this, like window.location, window.location.href='del.aspx', window.location.assgin, nothing is working, Plzzz suggest me,
how can i solve this issue, becuasee i dont want to open a new window, i want to open in d same window only.

Regards,

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900