Jump to content

Explorer blocking basic java


dgbullar
 Share

Recommended Posts

Pardon me, I am new to the coding and web design world and this question is very basic.When I use simple java for mouse over swap image functions Explorer blocks the script from running when I preview my work. It happens when I hand code or use Dreamweaver. Can I prevent this?Or is it happening because the site is on my Computer instead of a legitimate server?Thanks Much, Dave

Link to comment
Share on other sites

java script should execute fine without a local server. If you have winXP SP2 then IE6 got a security upgrade that by default blocks a lot of stuff. You will have to go into Internet Options and modify the security settings. If you are using IE7, again, you have to modify the security settings to allow "Active Content"

Link to comment
Share on other sites

You also don't have to use JavaScript to swap to hand, I-Bar, Move, Help, etc. You can do that with a CSS style (like below).

#image {	 cursor:pointer; /* Hand */	 cursor:url(); /* Custom */}

But that won't do your swap image thing. And Javascript for swapping an image would be:

<img src="blah.gif" id="swap" onMouseOver="swapImage('blah2.gif');" />

Where swapImage(); would be:

function swapImage(newSRC) {	 document.getElementByID("swap").src = newSRC;}

Link to comment
Share on other sites

  • 2 months later...
Guest javanew

The responses above suggest changing security settings. That's not a problem for my browser, but I want my code to run on the IE out of the box so that the average visitor to my website doesn't need any IE changes. I'm trying to do simple form validation. Is there any other way around IE blocking javascript?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...