Forum Moderators: open

Message Too Old, No Replies

onclick function not working.

         

disco2424

4:44 pm on Aug 17, 2009 (gmt 0)

10+ Year Member



Hello,

I hope somebody could guide me in the right direction. I have a page that I'm using java script on that has multiple links. When you click on a link it will show two different flash movies.

Everything is working when I click on one of the links but when I click on any of the other links nothing happens. If I refresh the page I can click on the next link I have to do this every time.

<p align="center" class="style2"><a href="#" onclick="showgraphs('adus10');">adus10</a> </p>
<p align="center" class="style2"><a href="#" onclick="showgraphs('adcan6');">adcan6</a> </p>
<p align="center" class="style2"><a href="#" onclick="showgraphs('impact2');">impact2</a> </p>

<script>
function showgraphs (servers){
mypie.setDataURL(servers+"_pie.xml");
mypie.render("piediv");
mychart.setDataURL(servers+"_chart.xml");
mychart.render("chartdiv");
}
</script>

I'm not sure what I need to do to make it so I can just keep clicking on different links and have it load what ever I want.

JAB Creations

4:29 am on Aug 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're generating URL's dynamically and pulling XML via AJAX I applaud you...but I also highly recommend checking your access log...as well as handling AJAX 403 and 404 errors...

- John

xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState=='4')
{
if (xmlhttp.status=='200')
{
ajax_load_page_import(xmlhttp,el_pos,el_id,sequel,id_focus);
}
else if (xmlhttp.status=='404') {alert('HTTP 404: The content was not found.');}
else if (xmlhttp.status=='403') {alert('HTTP 403: I\'m afraid I can\'t do that, Dave.');}
}
}

whoisgregg

1:51 pm on Aug 18, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It looks as if you are using some kind of charting/graphing library to actually render that data?

If so, it may not actually support changing data sources. Or, it may require a different function if you are changing the data. Does that library have a support forum? If so, you may find others who have experienced this same issue.