Jump to content

make browser ignore url of link


dadamssg87

Recommended Posts

I know this is really simple but i can' t figure out how to make javascript ignore the url of a link. here is some snippets

 

<div id='previous'><a href='blah.html' onclick='ajaxMonth(7,2011,77)' class='previous_month'> <<</a></div>

 

and then here is my javascript function...i'm using jquery

 

function ajaxMonth(X,Y,Z){
var changemonthlink = "http://localhost:8888/releventz/ajaxcalendar/view/" + X + "/" + Y + "/" + Z;
$("#ajaxdiv").load(changemonthlink);
return false;		
};

 

i thought the "return false;" part would stop the browser from going to the link(blah.html) but it definitely doesn't. If i set the a href="javascript:voide(0);" it works fine but i want to keep the url in there just in case people have javascript blocked.

 

any help would be much appreciated. thanks!

Link to comment
https://forums.phpfreaks.com/topic/239200-make-browser-ignore-url-of-link/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.