Armenian Knowledge Base

Armenian Knowledge Base (https://forum.armkb.com/)
-   Web Development (https://forum.armkb.com/web-development/)
-   -   JavaScript: Link with confirmation in frame (https://forum.armkb.com/web-development/9117-javascript-link-confirmation-frame.html)

Aram Ghazanchyan 21.11.2003 11:23

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

Aram Ghazanchyan 24.11.2003 06:07

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

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


All times are GMT. The time now is 21:52.

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