shox
shox

Reputation: 1160

JQuery Ajax Performance (JSON)

i have a page made AJAX/HTTP Request and the result is JSON formatted . using JQuery GET :

$.get('..',{..},function(data){
   console.log('Hey Iam finish !');
},'JSON')

The problem is console.log('Hey Iam finish !'); executed after many seconds (3>) as Firebug says .

Server : WINDOWS IIS ( Unfortunately ) , PHP .

Server Code : i try to remove JSON and just echo : echo "HI"; the result is same .

UPDATE

Summary : Firebug says the AJAX request finish but result appear only after 3> seconds

Upvotes: 1

Views: 585

Answers (3)

shox
shox

Reputation: 1160

The problem was in FireBug 1.8.4( FireFox 5/Linux Mint) it not give the accurate response time , i try firebug lite on chrome , and it give the accurate one .

Upvotes: 0

Crab Bucket
Crab Bucket

Reputation: 6277

I found problems with the JSON parsing causing script timeouts in IE. Using eval rather then JSON.parse was quicker. But only any good if you absolutely trust the source of the JSON i.e. it's from you. Even then it might not be a risk worth taking

Upvotes: 0

red-X
red-X

Reputation: 5138

Your serverside code is taking a long time to process, you should check to see if there is any time to gain in optimizing there. Your Javascript/jQuery is not the problem here.

Upvotes: 2

Related Questions