Hi,

I relative new to JQuery but I have some code that works fine in
Firefox, IE and Opera, but seem to be having a problem with Chrome and
Safari.

Here is  part of the code:

$("form#quiz_form_1").submit(function(){

      alert("This is testing....");

      $.post("question_result.asp",{ quiz_answer: $("input
[...@name='quiz_answer_1']:checked").val(), currdiv: $("input
[...@name='currdiv_1']").val() },
       function(xml)
      {
            question_response(xml);
       });//end of $.post

       return false;
 });

here is the function question_response

function question_response(xml)
        {

                //next div to show
                var next = $("nextdiv",xml).text();
                var current = next - 1;

                                 alert("This is test");


                //if the it was the correct answer
                if ( $("answer",xml).text() == "1")
                {
                        //display next part of the story
                        $("#story_"+next).slideToggle("slow");

                        //diplay next quiz
                        $("#quiz_"+next).slideToggle("slow");

                        //display message to answer
                        $("#answer_"+current).html($("message",xml).text());

                }
                else
                {
                        //display message
                        $("#answer_"+current).html($("message",xml).text());
                }
    }

I place alert screens for debugging, the alert screen in the function
question_response is never display in safari or Chrome I don't know if
there is problem with the Ajax code.

Thanks!


On Feb 4, 5:05�am, Javier Martinez <ecentin...@gmail.com> wrote:
> Sure!
>
> Createdhttp://dev.jquery.com/ticket/4058
>
> Hope there is some easy patch, if not, I will regret to 1.2.6 inmediately :(
>
> 2009/2/3 John Resig <jere...@gmail.com>
>
>
>
>
>
> > That's odd. Could you file a bug on this?
> >http://dev.jquery.com/newticket
>
> > Thanks!
>
> > --John
>
> > On Tue, Feb 3, 2009 at 10:39 AM, Javier Martinez <ecentin...@gmail.com>
> > wrote:
> > > I'm creating a component for an application I'm developing and I have
> > > upgraded jquery to the last version to get it's speed boost.
> > > After some testing I have seen that my component is not working correctly
> > in
> > > webkit browsers because there is some bug with the new Sizzle selector of
> > > the new jquery.
> > > I can't provide my source files, but I have created a simple test case
> > that
> > > shows this error.
>
> > > <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
> > > � � "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
> > > <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
> > > <head>
> > > � � <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
> > > � � <script type="text/javascript" src="jquery.js"></script>
> > > � � <script type="text/javascript">
> > > � � � � $(function() {
> > > � � � � � � var container = $('#container');
>
> > > � � � � � � var containerSelecteds = function() {
> > > � � � � � � � � return container.find('ul.selected');
> > > � � � � � � };
>
> > > � � � � � � var bodySelecteds = function() {
> > > � � � � � � � � return $('ul.selected');
> > > � � � � � � };
>
> > > � � � � � � var select = function(nodes) {
> > > � � � � � � � � containerSelecteds().removeClass('selected');
>
> > > � � � � � � � � nodes.addClass('selected');
>
> > > � � � � � � � � // the container html show me that the element has the
> > class
> > > "selected"
> > > � � � � � � � � alert(container.html());
>
> > > � � � � � � � � // webkit (chrome and safari) says that there are no
> > > elements inside of <container> with the class "selected"
> > > � � � � � � � � alert(containerSelecteds().length);
>
> > > � � � � � � � � // but the element exists in the dom, and it has the
> > > classname "selected" !!
> > > � � � � � � � � alert(bodySelecteds().length);
> > > � � � � � � };
>
> > > � � � � � � var element = $('<ul
> > > class="someclass"><li>MyText</li></ul>').appendTo(container);
> > > � � � � � � select(element, false);
> > > � � � � });
> > > � � </script>
> > > </head>
> > > <body>
> > > � � <div id="container" style="border:1px solid
> > > #ccc;height:300px;width:300px"></div>
> > > </body>
> > > </html>
>
> > > I will try to explain the error: I'm inserting a node inside the
> > "container"
> > > div, and applying a classname "selected" to this node. After this, I want
> > to
> > > select the nodes inside "container" that have this classname. Firefox,
> > IE,
> > > etc, says that there is one node inside "container". But webkit browsers
> > > says that there is a node with this classname in the dom, but not inside
> > > "container".
>
> > > I think that this is a quite simple css selector, so I don't know why it
> > > fails.
>
> > > Thanks.
>
> > > PD: it doesn't fails with jquery 1.2.6- Hide quoted text -
>
> - Show quoted text -

Reply via email to