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 8146467
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T14:00:46+00:00 2026-06-06T14:00:46+00:00

I will try and word this question the best I can, for it is

  • 0

I will try and word this question the best I can, for it is very hard to explain. Basically, I am building a phonegap iphone application that connects to this news site and parses the main articles for reading, using mostly the jQuery function load(). the problem is, the site has an iffy mobile version that, when accessed using an iphone, sometimes automatically loads the mobile site and other times loads the main site. They have different reference classes and ID’s so (as I built around the mobile site) if the main site is loaded, my app is completely useless. The website does have a script that sets (most likely) a session variable that determines whether to load the mobile or desktop sites, and it is found here:

http://www.macrumors.com/mr-toggleMobile.php?mobile=1

A 1 will set the mobile site and a 0 will set the desktop site. It works both on mobile safari and normal safari. Is there a way, using this script and javascript/jquery, to change when using the load() method whether it pulls the mobile site or desktop? (I would need desktop in a few cases). Thanks!

  • 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-06-06T14:00:48+00:00Added an answer on June 6, 2026 at 2:00 pm

    Instead of using load(), use ajax().

    This way you can set up the data option for the url. Here is the explanation of data:

    "Data to be sent to the server. It is converted to a query string, if not already a string. It's appended to the url for GET-requests. See processData option to prevent this automatic processing. Object must be Key/Value pairs. If value is an Array, jQuery serializes multiple values with same key based on the value of the traditional setting (described below)."

    For e.g.:

    $.ajax({
        url:"http://www.macrumors.com/mr-toggleMobile.php",
        data:"mobile=1",
        error: function(jqXHR, textStatus, errorThrown){
            //textStatus is the error text, like timeout or abort
        },
        success:function(data){
            //data is the downloaded page. Make your stuff here
        }
    });
    

    Since you said sometimes you need one or other, you could make a function:

    function getData(var){
        $.ajax({
            url:"http://www.macrumors.com/mr-toggleMobile.php",
            data:"mobile="+var,
            error: function(jqXHR, textStatus, errorThrown){
                //textStatus is the error text, like timeout or abourt
                return "Error: "+textStatus;
            },
            success:function(data){
                //data is the downloaded page. Make your treatment here
                return data;
            }
        });
    }
    

    Then you call like:

    var newsPage = getData(1); //1 for mobile, 0 for normal
    //do whatever you need with newsPage, like a if for checking if came starting with 'Error'. If not, then seems ajax was successful.
    

    For more descriptions and options, check $.ajax() at jQuery’s API Page

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I will try to make this as clear as I can, but if you
I will try and set the scene as best i can. *lights candle What
Hello I will try my best to explain my problem and I really hope
OK, I don't know how to word this question, but maybe my code will
Ok, not really sure how to word, but will try my best. I have
I will try to explain the situation as it is a little bit more
I will try and illustrate my question with examples, I am attempting to create
I will try to be as clear as possible because I can't get anybody
I will try to keep this as simple as possible. I have a rather
I will try to explain a simple app scenario: My app goes right to

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.