ajax search suggest autocomplete, server keep querying - ajax

ajax search suggest autocomplete. when i input something, ajax sends them to the server, query them and send back to client. But sometime when i input some words, ajax sends them to the server, server keep querying them. Should I set up timeout?

I would think so. You actually need to give more background info. There is too less info to make any guesses or suggestions...

I using workbench. So I upgraded it to newer version. It looks like its working fine

Related

Grails - execute check on every request

I’m looking for a neat way to execute a check to see if there are any messages in an inbox (realtime) in a Grails 2.x application.
I’ve moved away from polling via ajax to websockets, which is great at the point where someone actually sends you the message, but when you change to another screen, the “count” still needs to be initialized.
Can anyone advise on a elegant way of doing this?
Interceptors are not ideal as I need to check across just about all controllers
Filters are not ideal because on some screens with graphs there are many ajax request, the check would be run many times for each request.
I’m wondering if there are any other solutions that I’m not thinking of.. but possibly not.
A filter that disregards the check if a request header indicates an Ajax request would work.
Depending on where you need this "count" you could: In your layout (main.gsp for instance) call a tag library which makes use of a service to fetch the count. That way it's only applied to GSPs where the layout is applied (e.g. not any ajax request).

How to Trace Ajax Call Back or Debug Ajax Requests in Chrome or any other Good and Famous Browser

I'm doing a project which ,obviously, uses Ajax to handle lots of requests from User Interface. Once of which is to "Filter" the given list of users. I'm using it with Laravel at back end.
So the scenario is that when I filter users by their company it works perfectly, but when I filter users by locations, it shows all the users from all locations instead of chosen location which means all the location ids are being passed. Code is written by some one else. I don't know where to fix it. So I want to know that Chrome supports some good tools to handle and debug Ajax request but don't know how to do that. Can some one plz suggest me the right way to handle, debug and explore the call backs of Aajx request so I could also save my time????????????
You can use the google chrome devTools console and go to the Network menu. It works great.
If you want more you can use Charles

What exactly counts as using AJAX

From my understanding, AJAX requires the use of the XMLHttpRequest object. What I am confused on is the source of where the XMLHttpRequest object is connected to? In the school projects, I have connected it to XML and mySQL and was told that I am doing AJAX. What if I connect the XMLHttpRequest object to a PHP script which contains an array of data? Would that count as AJAX?
The reason why I ask is because I was thinking of adding AJAX to my resume, but since this area seems so broad and I have had limited experience with it, I want to make sure I have a clear understanding of this technology.
The AJAX part is just how the request is made from the client. If it happens asynchronously using XmlHttpRequest, it doesn't matter where the request is going :-) It could be a request to an server side script in PHP, a JSON file, an xml file, or anything else.
It's not broad at all. Any time you do an async web request (actually, it doesn't even have to be async, but that's really the best way to to use it) via javascript (rather than through a Form submit) you're using AJAX. What you connect to or what you retrieve is irrelevant.
Without being rude, I'd like to point out that if you state on a resume that you possess "a clear understanding of this technology" then you're not being honest, since you're asking this question, which indicates that your understanding of the technology isn't "clear".
If, however, you're totally confortable with the use of Ajax and were simply not entirely clear on it's lexical definition... well... now you should be.
yes ,the ajax can used for all language,soever java or asp and php

jqGrid save state with local json data

I need to persist the sort, filter and pagination state of a jqGrid that is loading the full data set from the server initially via JSON and then running locally from then on. I've tried jQGridState but was unable to get it to save anything but nulls (apparently I'm not alone). I've also tried the solution from Remember (persist) the filter, sort order and current page of jqGrid but was unable to get it to even create the cookie.
Has anyone worked through either of these solutions with local data or made something work another way?
thanks in advance...
Have you tried using jquery's cookie plugin. Here's an example of someone who got it working:
http://www.trirand.com/blog/?page_id=393/feature-request/Save%20state

JMeter Test Plan Login Issue

I was hoping someone could shine some light on my problem. I am in the process of load testing a website. For authenticity, I would like to simulate users logging in and such. JMeter refuses to comply. I have tried manually using HTTPS requests, HTTPS spoofing that is provided, and exporting login scripts from Badboy. Using the View Results Tree listener after running a test, it seems that everything is working, but in the end I am always redirected to the login page. The cookie appears to be functioning properly as it displays the same session for each request.
Thanks in advance for any wisdom you all may offer.
While badboy is a great tool to create jmeter test in https.
But on our apps, badboy seem to add get request that didn't work at all, I had to remove them manually to fix the problem.
And if you have a token or session id in your cookies, it's doesn't take care of it for you so you got to figure out how to extract them with a reg-ex extrator and put in a variable that your test will use.
These problem were very specific to our apps not sure it apply to you, but if you remove unessary request and take care of sending back your token/session id it might do the trick.
I was facing the similar issue sometime ago but since my web application was JSF based I had to take care of the javax.faces.ViewState.
In my case every response had a JFV and I had to pass it as a parameter to the next request using Regular Expression Extractor.
Kindly check if your application is having any such problem.
Regards

Resources