SitePoint Sponsor

User Tag List

Results 1 to 9 of 9
  1. #1
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    accessible popups

    i was wondering if anyone knows of a better way to make a popup accessible to folks with out javascript...

    this is what I have currently:

    <a href="http://www.cnn.com/" target="newWindow" onclick="window.open(this.href, this.target,'toolbar=0,location=0,directories=0,status=0,menubar=1,scrollbars=1,resizable=0,width=450,height=550'); return false">click here</a>

    I know it isn't quite right...
    mainly i want to be able to spec out the popup for people with js and for those that don't - i just want to open a new window.

    any help is great. thanks.

  2. #2
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If a user doesn't have Javascript then you're not gonna get a popup. Simple as that.

    Actually...

    You might be able to use Flash to trigger a popup window. Using FS commands inside a movie timeline would do it.

    If you've got Flash, try that.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  3. #3
    SitePoint Enthusiast Jack Michaelson's Avatar
    Join Date
    May 2002
    Location
    Netherlands
    Posts
    30
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It seems to me that you can't find out if someone has js or not by using js. Not sure though.
    I think you have to use something else (ie. PHP) than Javascript to detect wether the user has js or not.

    If he does: pop-up script
    if he doesn't: new window script.

    Does this help?
    Jack

  4. #4
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i am not trying to find out if the user has javascript or not...
    i will assume that they do. but - i don't want to exclude the few folks that visit without javascript. those with javascript will get a nicely formatted window sized to my specs. those without javascript will get a new window using plain ol' HTML (target="newWindow").

    this method works for the most part... but it has a few problems (for example... in NS6 mac it opens the popUp and targets a new window). I just want to see if there is a better way.

    thanks for the comments.

  5. #5
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The method you're using already makes it more accessible than most popups because of the this.href. That's about as good as it gets.

  6. #6
    SitePoint Addict w3exit's Avatar
    Join Date
    Jun 2002
    Posts
    331
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Surfers w/o JS enabled a/cs for less than 0.5% of users. Check your stats ...

    it shouldn't matter if they can't see it .. just show them a msg to update their browser

  7. #7
    SitePoint Wizard
    Join Date
    Oct 2001
    Location
    Tucson, Arizona
    Posts
    1,858
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by w3exit
    just show them a msg to update their browser
    But don't you get it? It doesn't rely on whether or not the person has JavaScript; the link will open either way.

  8. #8
    Currently Occupied; Till Sunda Andrew-J2000's Avatar
    Join Date
    Aug 2001
    Location
    London
    Posts
    2,475
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by Jack Michaelson
    It seems to me that you can't find out if someone has js or not by using js. Not sure though.
    I think you have to use something else (ie. PHP) than Javascript to detect wether the user has js or not.

    If he does: pop-up script
    if he doesn't: new window script.

    Does this help?
    You can detect where someone has js on. You can do this in a variety of ways, using serverside and clientside,

    ie
    [VBS]
    <html><body>
    <% set browObj = Server.CreateObject("cyScape.browserObj")
    browObj.GetExtProperties
    response.write "Is JavaScript enabled: " & browObj.JavaScriptEnabled %>
    </body></html>
    [/VBS]
    http://www.4guysfromrolla.com/webtec...awk/faq5.shtml

    there are other methods btw

  9. #9
    SitePoint Enthusiast
    Join Date
    Jun 2002
    Posts
    69
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "Surfers w/o JS enabled a/cs for less than 0.5% of users. Check your stats ... "

    that may be true for the web population in total... but i often deal with a specific user group that is much higher...
    blind folks using lynx for instance... and upgrade won't help them...

    ---

    to the person that mentioned testing to see if someone has js enabled...
    i've used a solution where the js hid a <div> containing navigation for those without js - at the same time I had it write a new <div> containing the fancy pants version for those that did have js. so if the js wasn't enabled the default <div> couldn't be hidden and the fancy one couldnt be written...
    it wasn't testing so to speak... but it easily did the job.

    i've also done similar things with "display:none" in my css to show and hide info from browsers..

    just make sure you know how things break and you can find away to make it work.

    ---
    thanks for the comments everyone.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •