Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

self.location not wrking in IE 5

Status
Not open for further replies.

meenakshidhar

Programmer
Oct 19, 2001
77
MY
Hi Friends...
the following Javascript code is not wrking in IE5...it's wrking in IE6..
***********************************************************
function del(cust_id,username)
{
var agree=confirm("Are you sure you want to delete this customer?");
if (agree)
self.location.href='delete_customer.asp?cust_id='+cust_id+'&username='+username;
else
return false ;
}
***********************************************************

Regards
Meenakshi Dhar

 
you might want to try
Code:
document.self.location.href='delete_customer.asp?cust_id='+cust_id+'&username='+username;
add document before the self.

Thanks
 
if you wanna use location you should use by

document.location='delete_customer.asp?cust_id='+cust_id+'&username='+username;

without href, should work to

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
Actually i forgot to mendion why your code doesnt work

self object it's a reference to the window object.
window object has no location.
but window object has document object.

there for it should be
self.document.location
as far as i remember

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
tried all the three methods mentioned above..but still not wrking...
 
you have another problem then
Code:
aaa.html

<input type=button onclick="delUser(10)" value="Del">
<script>
function delUser(id)
{
 var conf=confirm("Delete?");
 if(conf)
 {
	document.location="aaa.html?id="+id;
 }
}
</script>

________
George, M
Searches(faq333-4906),Carts(faq333-4911)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top