Problem in IE6

I am developing a web app in php with help from javascript. But in IE6, javascript function is not being called after clicking a button. I have tried a lot to tackle the problem but eventually I have to land up here…

Here is the code I am using


<input type='image' src='button.jpg' id='button' name='name'   onclick='A();'/>


And javascript code is


function a()
{
alert('Output');
}

I have tried a lot of things after googling but nothing worked out. Nothing happens after clicking the button though it works in FF, Chrome. Can anyone help me…

The code you posted should not work in any browser. Post a live URL.

Your function name is different from the name your calling, IE is very sensitive to case types so if you simply change your onclick A(); to a(); it should work fine.

Your problem is something that happens from time to time and is very hard to pick up on, in your script you have the following function.

function act_update(para, page) {

  var myurl = page + '?' + para;
 
  $("#notice_div").html('Loading..'); 
  $.ajax({
    type: 'GET',
    url: myurl,
    success: function(data) {
      $(act_div).html(data).fadeIn("slow");
      $("#notice_div").html(''); 
//      window.setTimeout(update, 10000);
    [COLOR=Red][B]},[/B][/COLOR]
   
});
}

I have made the error bold and red so you can see it, what happens is in IE when it says a comma that’s not supposed to be there it automatically ends the script there and then while other browsers have been designed to read the code no matter if there’s a stray comma. To fix the error simply remove that comma and it should work fine after that.

I am really sorry for a() and A(). It was a spelling mistake. Perhaps please check out Walknshine.com.

Go to login button.It will call out javascript function in chrome, FF but not in ie6.

I hope I am clear now.

the code is

<input type='image' href="" src='login-button.jpg' id='button' name='login_user' value='Login'  onclick='a();'/>


function a()
{
alert('wefwef');
}

Can anyone suggest me anything??

No…sorry it didnt work out…even after removing comma…it was not working in FF or chrome…any other suggestion??

Are you 100% sure you updated your javascript.js file as i viewed your source again and nothing has changed.

I changed and and then rechanged to same one as I needed to login…okk…I am changing or removing the comma…

Sorry but you changed the wrong function, what you need to do is revert the change for the function you removed the comma in as that had no issues. Next find the act_update function which starts on line 234 and end on line 249. Inside that function you will find the stray comma which needs to be removed as per my previous post.

Sorry but that also did not work…u can see what I have changed…

I have even commented over there // removed comma 2

I looked at your source and i kept missing the main issue, in your file you have act_update repeated about 3-4 times which is a simple oversight, if you remove the repeats the errors should go away and everything should work fine.

Thank you very for solving my problem…:):):slight_smile:

No problem, glad to help.