Hi,

I wrote this code :

function sendSubtitle()
{
        var JSONsub = JSON.encode(sstitres);
        var req = null;

        if(!window.XMLHttpRequest && !window.ActiveXObject){ //
XMLHttpRequest non supporté par le navigateur
           alert("Votre navigateur ne supporte pas les objets
XMLHTTPRequest...");
           return;
        }

        req = new Request.HTML({url:'submitSub.php',
                onSuccess: function(html) {
                        //Clear the text currently inside the results div.
                        $('sub_list').set('text', '');
                        //Inject the new DOM elements into the results div.
                        $('sub_list').adopt(html);
                },
                //Our request will most likely succeed, but just in case, we'll 
add
an
                //onFailure method which will let the user know what happened.
                onFailure: function() {
                        $('sub_list').set('text', 'The request failed.');
                }
        });

        req.send('&sstitres='+JSONsub);
}


Which inject in a div the code above :


<p>0<br>0:00:04:978<br>0:00:08:121<br> A subtitle named FoobaR<br></p>

First question : why all <br /> come to <br> ?
Second question : the output is the same in IE7 and FF3, but the
display doesn't work on FF ( there is no return with the <br /> )
Where am I wrong ?

Are those behaviors known bug ?

Regards,

Reply via email to