Old 20-11-2007, 17:21   #1 (permalink)
Scott
sanddancer
 
Scott's Avatar
 
Join Date: Feb 2004
Location: South Shields
Posts: 2,921
Send a message via MSN to Scott
javascript alert

Whats the best way to do this then? Should I use it or is it bad standards these days? What should I use instead.

I'm basically needing it as a step before another website e.g. a user clicks on a link and the popup displays 'blah blah your leaving the site blah blah' user clicks ok and the linked site loads up.
__________________
  Reply With Quote
Old 20-11-2007, 17:26   #2 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
That sounds like a terrible usability problem. Huge mistake.

Try this: Flag & toggle external links with DOM scripting

I'm currently building a customized and expanded version of this script.
  Reply With Quote
Old 21-11-2007, 03:11   #3 (permalink)
Bill Posters
trouble free and loverlee
 
Join Date: Mar 2003
Location: YooKay
Posts: 2,968
Quote:
Originally Posted by pgo
Try this:
Flag & toggle external links with DOM scripting

I'm currently building a customized and expanded version of this script.

I'd be interested to hear what you've got planned, PGO.
Do tell.
  Reply With Quote
Old 21-11-2007, 10:01   #4 (permalink)
pgo
Senior Member
 
Join Date: Jan 2005
Posts: 12,358
Great script, by the way, Bill.

It's basically that and Preview Your Links with Unobtrusive JavaScript and the ability to open links to any file type you desire in a new window.

I'm just mixing all three things together and making it a cohesive whole. It will...
  • Allow external links to be opened in a new window (settings saved by cookie).
  • Mark links to known file types with a file type icon.
  • Allow the developer to add file types to the list of files (an array, actually) to open in new windows (most useful for PDF).
It's an excellent DOM/JS learning exercise for me. Obviously, credit will be given where it's due!

So far, I have it organized as:
  • config class (just variables that are configurable by the developer - keeps them in one place).
  • fileTypes class (replicates and extends the functionality of linkPreview script).
  • libJS class (same as yours Bill, removed two methods - in_array and hasJS).
  • extLinksToggle class (same as yours Bill, just changed the name).
I'm slowly figuring this thing out.

Last edited by pgo : 21-11-2007 at 11:25.
  Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search


Contact Us - Web Design Forums - Archive - Top
Search Engine Optimization by vBSEO 3.0.0 RC8