By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,566 Members | 1,779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,566 IT Pros & Developers. It's quick & easy.

Getting DHTML to let me use a javascript function for the URL

P: 1
I am not very good at DHTML, but I have a set of links that use DHTML and they work :)

But now the customer wants to have one of my DHTML links call a javascript function when it is clicked on. When I put it into DHTML, it treats everything between the " " like a constant. When I remove the quotes, it gives me an error.

One of the versions I have tried is:

DQM_rollover_image12 = "/images/nav_hospital.gif"
DQM_rollover_wh12 = "208,20"
DQM_rollover_xy12 = "0,240"
DQM_url12 = "/index.html onClick=UTC_Hospital()"

the javascript function I am trying to call is in index.html and it is called UTC_Hospital ()

Thanks for any and all help...I am at wits end and naturally they need this function to work asap.
Sep 29 '06 #1
Share this Question
Share on Google+
1 Reply


acoder
Expert Mod 15k+
P: 16,027
Set the URL to index.html:
Expand|Select|Wrap|Line Numbers
  1. DQM_url12 = "/index.html";
See if you can set onclick somewhere. If so, set onclick to UTC_Hospital(). If not, you'll need to modify the generated link:
Expand|Select|Wrap|Line Numbers
  1. // access the link
  2. var link = document.getElementById("linkID");
  3. // set onclick
  4. link.onclick=UTC_Hospital;
May 15 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.