The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript How come return false prevent redirection of link ?Urgent Re: How come return false prevent redirection of link ?Urgent


Hello Mr KiTT3N and everyone

ya u r right. the link can’t do both at the same time.

so i have placed the following code below the closed body in my template

<script type="text/javascript">

function fireEventDrpdwnMenu(element,event){
if (document.createEventObject){
// dispatch for IE
var evt = document.createEventObject();
return element.fireEvent(‘on’+event,evt);

// dispatch for firefox + others + Not supported in IE, which uses fireEvent() instead.
var evt = document.createEvent("HTMLEvents");

evt.initEvent(event, true, true ); // event type,bubbling,cancelable
return !element.dispatchEvent(evt);
//capture url
$url = window.location.href;
$id = $(‘a[href^=’+$url+’]’).attr(‘id’);
// alert($id);
// trigger my click for drop down to be displayed


It is working on firefox but with but not on IE 6,IE 7 ,opera and google chrome. On ie 6,ie 7 , opera and google chrome the page keep on reloading.

Please can someone help cause this is an urgent request.Thank you for kind replies