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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Prompting a User to Save When Leaving a Page

Status
Not open for further replies.

gorgered

Programmer
Dec 13, 2005
24
US
Hi,

I wanted to some thing similar to what this article was doing,
Is there any better solution than this? As it is difficult to impelement this is in each and every page for a project which is alreay in production and which has more than 50 pages and most of them are dynamic pages were in the names of the elements are from the DB.

Help or Ideas greatly appriceated.

Thanks
Gorge
 
Why not put the 4guys script in an external JS file, and link to it from your pages? Surely it can't be that hard to add 1 line to 50 pages - it shouldn't take more than a few hours for even a script kiddie with notepad to edit 50 text files, I'd have thought.

Dan



[tt]Dan's Page [blue]@[/blue] Code Couch
[/tt]
 
In fact... you may already have a common header include section in your web application - so just adding the javascript link to that single header include would effectively cause it to be used on every page that includes the header include. If you don't have this in place - it may be worthwhile doing it regardless.

I'd agree with Dan's suggestion - reuse their code... and give them credit for it (in the javascript comments).

Cheers,
Jeff

[tt]Jeff's Page @ Code Couch
[/tt]

What is Javascript? FAQ216-6094
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top