Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7690703
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:27:24+00:00 2026-05-31T20:27:24+00:00

I am using jQuery 1.6.4 with jQuery Mobile 1.0.1. I am running into an

  • 0

I am using jQuery 1.6.4 with jQuery Mobile 1.0.1. I am running into an issue anytime you link to a page that then tries to do a 301 redirect.

I’ve setup a sample page at: http://www.widgetsandburritos.com/jquery-mobile-test/

The only thing on this page is the jQuery Mobile includes and a link to another page that has a 301 redirect somewhere else.

<!DOCTYPE html>
<html>
    <head>
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
        <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
    </head>
    <body>
        <a href="301test.php">301 test</a>    
    </body>
</html>

301test.php has the following content:

<?php
header( "HTTP/1.1 301 Moved Permanently" ); 
header( "Location: 301success.html" ); 
?>

This should just simply pass the browser to 301success.html. It works if you directly go to that URL

http://www.widgetsandburritos.com/jquery-mobile-test/301test.php

But when you click on the link from the page using jQuery Mobile, it shows “undefined” instead. Is jQuery Mobile currently incapable of handling redirects?

Any possible work arounds?

Thanks for your help.

EDIT [3/23/12 12:41AM CST]

I also posted this problem on the jQuery Mobile forums. Somebody there recommended adding rel=”external” to the anchor tag. This technically works if all you are doing is making a link, but won’t fix the issue if you get to the redirect via some other mechanism, such as a POST request.

To illustrate, I’ve setup a secondary test at http://www.widgetsandburritos.com/jquery-mobile-test/test2.html

<!DOCTYPE html>
<html>
        <head>
                <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.css" />
                <script src="http://code.jquery.com/jquery-1.6.4.min.js"></script>
                <script src="http://code.jquery.com/mobile/1.0.1/jquery.mobile-1.0.1.min.js"></script>
        </head>
        <body>

                <form method="post" action="301test.php">
                        <input type="submit" value="test" />
                </form>

        </body>
</html>

Instead of arriving at the 301test.php redirect page from a link, it’s now the location of a form we’re submitting to. The context this would be used, would be such that if you submit a form with errors, it would stay on the same page allowing you to correct the errors. If there were no errors, it redirects you to a success page. This is done to avoid submitting the form again if a user refreshes their browser. It works brilliantly in normal web applications. But in combo with jQuery Mobile it doesn’t seem to work.

Just thought I’d give some additional context to anyone else following this issue.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T20:27:25+00:00Added an answer on May 31, 2026 at 8:27 pm

    Figured out the answer to my own problem. In the above, I mentioned that this was causing problems using the <form> tag. After browsing through the jQuery Mobile documentation I found this page: http://jquerymobile.com/test/docs/forms/forms-sample.html

    The trick here is if you’re doing a form, to force it to not use AJAX. You do this by adding

    data-ajax=”false” to the FORM tag.

    So this changes

    <form method="post" action="301test.php">
    

    to

    <form method="post" action="301test.php" data-ajax="false">
    

    And just to reiterate what was said above. If you need to do something with an anchor link, just add rel=”external” to it.

    So this changes

    <a href="301test.php">301 test</a> 
    

    to

    <a href="301test.php" rel="external">301 test</a> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jquery mobile. I would like to navigate from one page to
I am building a mobile app using Jquery mobile. It´s a multi-page app all
So I am using Jquery mobile with great success except for one issue. Now
I'm using jQuery Mobile for my application that runs mainly on desktop browsers. The
I'm using jquery mobile link and i'm setting it like below: <a data-theme=a data-iconpos=notext
I'm using jquery.mobile-1.0.1. I'm trying to make the page reload when clicking on the
I have an application that is using jquery, jquerymobile and spine.js running on phonegap
I'm using Jquery Mobile pagination plugin and trying to work it into a plugin
I'm using jQuery Mobile and trying to figure out how to change a page
I am currently using jQuery Mobile on a project and have run into a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.