Using javascript as a document source

Discussion in 'HTML / PHP / JavaScript / CSS' started by hridpath, Jun 25, 2003.

  1. Maybe someone could shed some light on a little problem that I am having. Basically, what used to work doesn't now.

    In the anchor tag <A> I sometimes make a method call to to some function when the user clicks the link. Instead of using a URL in the href=, I use href='javascript: callFunction();' I know it used to work with IE5 and NS2 ect. even though there was an onClick eventhandler. but for some reason this does not work with IE6.

    Does anyone have any information as to why this should occure?

    TIA

    Harry
     
  2. Hello Harry,

    One thing you might want to check is your href. Are you using single quotes as in your example below?

    href='javascript:callFunction();'

    For this to work you'll probably have to use double quotes:

    href="javascript:callFunction();"

    Might not matter though, just a thought. If you could post some of your code perhaps I could take a look at it. Do you receive an error when you click the link or does it just not do anything?

    Cheers
    baj
     

Share This Page