Results 1 to 3 of 3

Thread: var ns6=document.getElementById && !document.all

  1. #1
    Join Date
    Jun 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default var ns6=document.getElementById && !document.all

    1) Script Title: Cool DHTML tooltip

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...tmltooltip.htm

    3) Describe problem: The script works great no issues there. It really deals with the way I'm implementing it. I am using some software to create some web based training and using the tooltip for glossary word descriptions. Well the software I use uses a third party editor for the code called fckeditor(sucks). On some pages(not sure why not all thats why this thing is finicky) but the script will break the images on the page. So the tooltip works but my images are broke. Found out it's because of less than symbols and the && operator. I modified the script of all those operators to work so far except for one line:

    var ns6=document.getElementById && !document.all

    I'm still learning and I'm not sure what this line means. I know the first part but don't get the && !document.all part. Does anyone know a way to make this line without the && and if not maybe explain what this line is doing? Any help is appreciated.
    Thanks,
    Shaun

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    && means logical and. The ! means not. As to what the line is doing, it is browser sniffing, trying to determine what browser is viewing the page. Doing it this way isn't real good, but there are far worse ways. I don't think you can get rid of the && without making it more than one line. But that's OK, right? Here you go:

    Code:
    var ns6 = document.getElementById;
    if(document.all){
    	ns6 = false;
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    okerix (06-25-2010)

  4. #3
    Join Date
    Jun 2010
    Posts
    4
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default You rock

    You rock jscheuer1!! That was the last line I needed to fix. Now with your help I have beat this stupid editor. I hope you have a super day!

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
  •