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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T06:09:14+00:00 2026-06-18T06:09:14+00:00

I am trying to get response from a php page using jQuery Ajax. Everything

  • 0

I am trying to get response from a php page using jQuery Ajax. Everything works fine until I tried to explode an array and combined it elements to get a time 09:00.

Console says, Uncaught Error: Syntax error, unrecognized expression: unsupported pseudo: 00 and nothing displayed.

My code is,

$starttimeArr= explode(",",$comma_separated_starttime);// explodes 09,00,00
$endtimeArr= explode(",",$comma_separated_endtime);// explodes 17,00,00
echo $starttime= $starttimeArr[0].":".$starttimeArr[1];// combine to get 09:00. The line pop up the error
$endtime= $endtimeArr[0].":".$endtimeArr[1];// combines to get 17:00

How did I overcome this error? Any help will be appreciated.

My Ajax code is

jQuery("#_dob").change(function() {
                    jQuery.ajax({
                        url: "<?php echo $this->getUrl('deliverybydatepro/index/index') ?>",
                        data: "checkIn="+jQuery(this).val()+"&type=calendar",
                        type: "GET",
                        dataType: "html",
                        success: function(data) {
                           var $response=jQuery(data);
                           jQuery("#div1").html(data);
                        }
                    });
    });

The response page has a dropdown having an option "09:00". jQuery-1.8.0 triggers an error on it.

  • 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-18T06:09:15+00:00Added an answer on June 18, 2026 at 6:09 am

    Okay. Having seen the edited question with the JS code, the problem is clear:

    var $response=jQuery(data);
    

    This line is the cause of the error.

    The data variable is the response string from the AJAX request. This contains the string “09:00”, as expected.

    This means that your code is equivalent of calling jQuery('09:00').

    jQuery will try to interpret that as a CSS selector. It will see the 09 and try to find an element with that name. It won’t find one of course, but it won’t complain about that. However it will then see the :00 and assume that’s a pseudo-selector (like :before or :first-child, etc). Of course :00 is not a valid pseudo-selector, and jQuery will complain about that. So that’s where the error is coming from.

    So what to do about it? Well the answer is quite simple, really.

    You’re using this line to set a variable called $response, but then you’re never using that variable; you’re continuing to use the data variable. So really the whole of the line that is throwing the error is completely unnecessary. You may need a line like that if your PHP is outputting JSON or XML data, but not if it’s a plain string.

    So the solution is to remove that line entirely.

    Hope that helps.

    Just as an aside, to help you out for next time, it would have been fairly easy to find out which line of JS code was causing the problem by using the debugger in the browser. Just open the Dev Tools or Firebug, and run the code, and it would stop and show you exactly where the error is. A little bit of further work with the debugger looking at variables, and it would probably have become clear what the problem was.

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

Sidebar

Related Questions

I am trying following, 1. Get response using Ajax from the users selection which
I was trying to read a page from the same site using PHP. I
I've been trying to get a json response from google's geocoding service. I'm using
I'm trying to post some very simple data to a php file using jquery
I am trying to get the HTML page back from sending a POST request:
I am trying to download a CSV file from a URL using PHP Curl,
Hi i'm trying to retrieve response after passing some variables from javascript to php
I'm trying to get a JSON response and iterate through the data. Here is
I'm trying to do a preg match all on the response below to get
I'm trying get the visible portion of UIImage from an UIImageView . UIImageView takes

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.