Jump to content

Archived

This topic is now archived and is closed to further replies.

baiju

Redirecting a page using ajax

Recommended Posts

Hi

I done a login form. User name and password checking ajax script.
If password is wrong it showing correctly.
My prob is user name and password is correct, i want to redirect the page to members area

Share this post


Link to post
Share on other sites
Use this javascript code: [code]location.href = 'new location here';[/code]

Wrong forum by the way.

Share this post


Link to post
Share on other sites
Nor is it an extension, it is a combination of technologies. It uses JavaScript's XmlHttpRequest and it uses XML.

Share this post


Link to post
Share on other sites
Actually... I've been using AJAX techniques for quite some time and I have YET to use XML with it.

Share this post


Link to post
Share on other sites
Hi,

i guess you would have two JS functions one for request to the server and other for getting back the responce from the server. In the JS function which receives the responce you can user location.href='file.php'

Share this post


Link to post
Share on other sites
[quote author=ober link=topic=111639.msg453873#msg453873 date=1161188224]
Actually... I've been using AJAX techniques for quite some time and I have YET to use XML with it.
[/quote]

Then I guess it techinically wouldn't be AJAX but just the use of XmlHttpRequest as AJAX is short for "Asynchronous JavaScript and XML". If you remove one of the parts then it wouldn't be AJAX. I don't use XML myself either though...

Share this post


Link to post
Share on other sites
Someway of topic perhaps...

There are many ways of twisting this - if you use responcetext and get html in return you would perhaps call it AJAH (AJAXH for xhtml ??) or something, i still feel that i can call my usage of AJAX as AJAX even if i don't return XML - the principal of usage is the same exept for the way you treat the returned responce. If the responce is echoed out or adjusted further with a javascript is a matter of habbit if you ask me. I try to do things as little complicated as possible.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.