Click to See Complete Forum and Search --> : Safe and Unsafe Javascript?


sophiagk
July 19th, 2004, 04:09 AM
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*

bobo
July 20th, 2004, 01:33 PM
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:


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.

sophiagk
July 22nd, 2004, 06:32 AM
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