Click here to Skip to main content
15,921,660 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am working on asp.net website in which i am getting data by using jquery ajax.
here is my code.

C#
     function PostSubChapter(qbt_id) {
    debugger;
    var v1 = 'qbt_id:' + qbt_id;
    $.ajax(
    {
        type: "POST",
        url: '<%= ResolveUrl("~/QuestionBankSubChapters.aspx/GetChapters") %>',
        data: '{' + v1 + '}',
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (result) {
            if (result.status === "OK") {

                alert('Comment posted');
            }
            else {

                fnDisplaySubChapter(result, qbt_id);
            }
        },
        error: function (req, status, error) {

            alert("Sorry! Post failed due to error");
        }
    });
}


and my web method is

C#
[WebMethod]
public static List<bo.questionbanksubchapters> GetChapters(int qbt_id)
{

   BAL.QuestionBankSubChapters oQBTSC = new BAL.QuestionBankSubChapters();
   List<bo.questionbanksubchapters> lstQBTSC =      oQBTSC.getQuestionBankSubChapters(qbt_id);
   return lstQBTSC;
}



for your understanding here i am mentioning the link of the website
Link is : "http://skillgun.com/Home.aspx"

Open these in Fire fox and chrome both then Click on Arithmetic then it will display 2nd screen.
Just see the o/p in both the browser you'll understand. In chrome its working properly but in Firefox its not.I am not getting understand what is the reason behind these.Sample code already i mentioned above.
I am using jquery-1.8.3.min.js for getting the result.The callback function is working fine in chrome and IE but not working in FF
I checked a lot and find my data is coming but a the time of displaying it in FF its showing nothing.

Please help me....
Posted
Updated 27-Jun-13 2:23am
v3
Comments
Mahesh Bailwal 27-Jun-13 10:44am    
There can be error in fnDisplaySubChapter function. For debugging put alert in else section just before calling fnDisplaySubChapter. This will clear out where the problem is.

1 solution

The data on the left panel is not displaying because you have used "innerText". Please use "innerHTML".

And as for the AJAX, in firefox result seems to be returning asynchronously. Please try async:false in the AJAX call and see if that fixes the issue.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900