Jquery Apache - IE problem

Posted by Soldierflup on Stack Overflow See other posts from Stack Overflow or by Soldierflup
Published on 2010-04-21T14:24:55Z Indexed on 2010/04/28 2:53 UTC
Read the original article Hit count: 239

Filed under:
|
|

I'm having a button tag on my page with a value.

<button class='btn' value='value'>show value</button>

I have this jquery code :

    $('.btn').click(function() {
    var w = 'value = '+$(this).val()+' / text = '+$(this).html();
    alert(w);
});

In FF, no problem the result is ok (display: value = value / text = show value).
The problem comes with IE8 which displays a different results from my testing server and the production server. The testing server is my local machine with a standard XAMPP installation. The productionserver is a server based on linux with apache, php and mysql.

Result from the testing server is ok (display like FF), the result from the production server is not good (displaying : value = show value / text : show value).

Anyone an idea if it is apache that causes the error ? I know there are some issues with the use of val() because IE is considering it as an attribute and not a value.

The problem is that changing the jQuery from val() to attr('value') is quit a lot of work (this implementation is already on a lot of pages) and I think it could be much easier to change something on the webserver.

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about internet-explorer