Armenian Knowledge Base  

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

Reply
 
LinkBack Thread Tools
Old 21.11.2003, 11:23   #1
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 36
Posts: 896
Downloads: 1
Uploads: 0
Reputation: 9 | 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
Reply With Quote
Old 24.11.2003, 06:07   #2
Web developer
 
Aram Ghazanchyan's Avatar
 
Join Date: 09 2002
Location: Yerevan
Age: 36
Posts: 896
Downloads: 1
Uploads: 0
Reputation: 9 | 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 With Quote
Reply

Thread Tools


На правах рекламы:
реклама

All times are GMT. The time now is 20:43.


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