Check your server logs to see if the request is coming in.

Remove all logic in your client-side callback and do a basic request.

What library are you using on the client?

What error are you getting in the console on the client?

Adrian

On 27 October 2014 09:52, pradeep raj <pradeepjack...@gmail.com> wrote:

>
>
> <http://stackoverflow.com/questions/26584291/ajax-request-not-working-in-expressjs#>
>
> Hi Sir/Madam,
>
>
> If i make an ajax request from the client side to the server side '
> http://192.168.0.83:3131/getWorkspace' i got request fails error
> means(the request was cancelled).
>
> Client Code : apf.ajax("http://192.168.0.83:3131/webcompile?callback=?",{
> method:"GET", crossDomain: true, contentType: "text/plain; charset=utf-8",
> callback:function(data){ if (data != "undefined" || data != null || data
> !="") { console.log("o/p: "+data); alert("O/P :"+ data.toString()); } } });
>
>
> Server Code : app.get("/getWorkspace", function( req, res) { //getting
> session values var _workspacename = req.session.worksapcename2;
> console.log(_workspacename); res.send(_workspacename); });
>
> when normally i'm redirect this url in browser it's works fine. but when i
> make ajax call it's return *Undefined*
>
> Kindly please help me on this,
>
> Thanks in advance,
>
> Pradeep Raj.K
>
> --
> Job board: http://jobs.nodejs.org/
> New group rules:
> https://gist.github.com/othiym23/9886289#file-moderation-policy-md
> Old group rules:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nodejs+unsubscr...@googlegroups.com.
> To post to this group, send email to nodejs@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nodejs/0c4d1aa6-311b-4251-b316-6dac057ec7ca%40googlegroups.com
> <https://groups.google.com/d/msgid/nodejs/0c4d1aa6-311b-4251-b316-6dac057ec7ca%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to nodejs+unsubscr...@googlegroups.com.
To post to this group, send email to nodejs@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/CAH368SQ5b1-PFH6GbHMiAg-kTBF%3D50YYUGqwTCTgHSKCVZY-Pg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to