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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:26:56+00:00 2026-06-11T19:26:56+00:00

I am using jquery ajax calls, to send text to the server. The text

  • 0

I am using jquery ajax calls, to send text to the server.

The text (user input), that is sendt to the server, may contain questionmarks.
If there is just one questionmark “?” its no problem, but if there are two questionmarks “??” side by side, then the ajax call stops working propperly.

text example:

Is this a text example?? yes it is…

will produce:

Is this a text examplejQuery17205792287601360849_1347644361296 yes it
is…

I think the root of this problem is the caching of the ajax call:

cache Default: true, false for dataType ‘script’ and ‘jsonp’

If set to false, it will force requested pages not to be cached by the
browser. Setting cache to false also appends a query string parameter,
“_=[TIMESTAMP]”, to the URL.

Anyhow two ?? side by side in a text string sendt by an jquery ajax call with json makes the query string parameter to show up in the original text instead of the two ??

Now what is the best solution for this?

Can anyone help me write a str.replace function with regex that ensures that there are not two ?? side by side in the textstring…?

Thx!

// text will be stored in the database via ajax call
$.ajax ({
    type: "POST",
    url: "ajax/ajax_special_functions.php",
    data: data_string,
    dataType: "json",
    success: function(recive_obj) {

        // Some more code...
    }
});

The text is contained in data_string…
If there are two ?? in the text, the ajax call is still fired und the data is transmitted to the server, but the callback function will never get fired…

Update:
I have solved this problem temporarely with a regex str replace – If someone discouvers a more clean way to solve this problem, please let me know.

  • 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-11T19:26:57+00:00Added an answer on June 11, 2026 at 7:26 pm

    I would go with Kevin B’s suggestion, but here’s the regex if you really want one:

    str = str.replace(/\?+/g, '?');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In jQuery Datatable I am fetching data using Ajax i.e. Server Side Processing. Situation
I am using jquery for all my ajax thing, I don't know if that
I am trying to invoke webservice using jquery ajax call. I am using jasonp
I'm using a jQuery ajax call to get several entries from a large set
I am loading feed-items into a ul using this jQuery .ajax() call, which I
I'm using jQuery to make an Ajax call using an Http Post in ASP.NET
I am using jQuery to make an AJAX call to a ruby method in
I'm using JQuery to make an Ajax call. I used a sniffer to catch
I am making an AJAX call using jQuery to an .ascx control's method in
I'm currently new into client-side programming, especially using the Jquery Ajax method to call

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.