Forum Moderators: open
I have here a quite boring problem with javascript.
I code using UltraEdit => it's not a problem caused by code added by HTML editors and so on.
Well, here is the problem.
the <A HREF = "Javascript:CallMethod()"> is not working as it should. For an obscure reason, the text between "" => "Javascript:CallMethod()" is seen and treated as an URL by my browser (IE 6 / Crazy Browser). I can put whatever i want between these brackets, the result is the same : the browser tries to open the link given in the HREF parameter.
I have tried to use <A HREF = "Javascript:void(0);" and things like that but the result is always the same : the browsers never sees the JavaScript code as it should.
I think the error comes from a configuration in IE or something like that but i can't find any clue.
I would be grateful to anybody who could help me with this one
To be sure, this is some code that is not working :
<a HREF = "javascript: void(0)" onClick = "OpenPage('DisplayPicture.htm', 'Jean-Marie Mengeot', 'images/gallerie_ccd/Mengeot/Normal CCD/image001.jpg')">...<IMG SRC = "..." </A>
theOnclick event works perfectly fine (=> the method is called) but HREF opens another page whose url is Javascript:void(0)
I want to use the HREF parameter to have the cursor changed
(I know that i can use some tricks to show another cursor but it's more work and doesn't solve a problem that shouldn't happen....)
thanks in advance
Jerarckill
this seems to work but it's not the case. The return false statement will make my Href not responding (=> not going anywhere) but the method put inside the" " will not be called at all. => i can't call anything in the HREF parameter like that
----------------------------------------------------------
<a target="_self" HREF="javascript: void(0)" onClick="OpenPage......
or:
<a HREF="javascript: void(0)" onClick="OpenPage......; return false"
----------------------------------------------------------
that's what is told by everybody (and seems to work everywhere :-) but it's not responding in a good way here (Browser tries to open a page called javascript: void(0) instead of being set to null
In fact, i think that the safest way to correct the problem is not using the HREF param at all. I now use :
<A style="cursor:hand" onClick = "Some Javascript Code">Click me</A>
where the style will make the cursor change to a hand and onclick event load the page (or anything else).
That doesn't solve the problem but it's a good way to make things work correctly.
If you have any other idea, they are welcome ;-)
<edit> i see i this duplicate post, sorry.
<edit>removed useless piece of text
[edited by: ikbenhet1 at 1:46 pm (utc) on July 6, 2003]
do u like to use onmouse*** to simulate ":hover" effect?
do u like to play the click.wav by yourself?
do u like to set border to dotted in onmousedown? (it's a IE effect for clickable link, appears when user click on a link)
and even to simulate the ":active" effect?
if all the answers to the aboves is "no", then u can, and are suggested to use <span> :P