Go Back   Armenian Knowledge Base > Technical sections > Webmaster Zone > Web Development

Reply
 
Thread Tools

JavaScript: Link with confirmation in frame
Old 21.11.2003, 11:23   #1
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 44
Posts: 896
Rep Power: 0
Default JavaScript: Link with confirmation in frame

I have 2 frames, and I have a link in 2nd frame. I want to put a confirmation on that link for page redirection. The code is the following:

<a href="javascript:;" onclick="javascript:if(confirm('Are you sure you want to delete this item?')) self.location.href='new.asp'; else return (false)">link</a>

It's not working. I tried to replace self.location.href with
parent.location.href - working
parent.frames[0].location.href - working
parent.frames[1].location.href = self.location.href (current document) - not working

Old 24.11.2003, 06:07   #2
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 44
Posts: 896
Rep Power: 0
Default

Т.к. спец-ов по javascript как оказалос' не очень то и много, то сам отвечаю на свой же вопрос, для тех кому интересно.

<a href="new.html" target="frame2_name" onclick="return confirm('Are you sure you want to delete this item?')">link</a>
Reply




Реклама:
реклама
Buy text link .

All times are GMT. The time now is 00:54.
Top

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.