CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Posts
    4

    Cool Safe and Unsafe Javascript?

    Hello all,

    Theory question:

    If i am accessing the Internet from a corporate network (you know how they are) and in principle scripts do not work. ?How come some Javascript functions and some does not? In other words: Why some websites - with javascript menus - are displayed correctly and some aren't?

    Am i missing something? Is it in the code? Is there some sort of way to declare the script as "safe" or hide it from the server in some way? Or this is all bull... and basically something is wrong with the code?

    Check out http://www.digital-era.org/digitalera/english.html (should work with Explorer and Netscape but not Mozilla and Opera - one thing at a time). What is wrong with the drop - down menu? Works from home, doesn't at work... (Upon checking out the link and seeing the code refrain yourselves from being overly critical to a beginner)

    Would appreciate any pointers!

    Sofia

    *Beginner's Luck*

  2. #2
    Join Date
    Jun 2004
    Posts
    142
    Hello Sofia

    Could be a number of reasons why the drop down doesn't happen. It could be code and security combined. I know Norton Web security 2000 firewall stops dropdown menus like yours if the user sets pop-ups to stop. If your a newbie well then welcome to scripting for various web browsers. What you code in one, more than too often doesn't work in the other. Take the code below that just shows and hides layers as an example. Before you even start writting the function you need to check wich browser the user is using like so:

    Code:
    if (ie4) {document.all[lay].style.visibility = "hidden";}
    if (ns4) {document.layers[lay].visibility = "hide";}
    if (ns6) {document.getElementById([lay]).style.display = "none";}
    }
    function showlayer(lay) {
    if (ie4) {document.all[lay].style.visibility = "visible";}
    if (ns4) {document.layers[lay].visibility = "show";}
    if (ns6) {document.getElementById([lay]).style.display = "block";}
    so you have to say "visible" in one, and "hide" for another..... and so on, I know it sucks but thats how it is.

    My solution to you would be.. use Macromedia Fireworks, its awsome for drop down menus. And after that if your dropdown menus don't work you'll know it's a security issue.

  3. #3
    Join Date
    Jul 2004
    Posts
    4

    Always dreaded this!

    Ah this is exactly why I am so bad at this! Always dreaded Fireworks. Will try though.

    Thank you for the advise ' I´ll be sure to post the results!

    Sofia
    *Beginner's Luck*

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured