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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:58:31+00:00 2026-05-16T22:58:31+00:00

On this site: http://www.rent-turkey-property.com/ I have it set so that when you select a

  • 0

On this site: http://www.rent-turkey-property.com/

I have it set so that when you select a region from the dropdown (left box) it pulls in the towns for the town menu using jQuery.getJson

My code worked when it was in the head of each page but seems to have broken when moved into an external file (or maybe another change broke it, sure I checked it after transfer to external)

The trouble is everything seems to be working fine. Firebug is telling me I have the data, but it won’t update select#town

Driving me insane.

UPDATE:

Update

I have now found that it is an error with the JSON (parsererror Invalid JSON) but it worked fine before and I haven’t changed it.

The only thing I have changed, that I haven’t been able to reverse for testing is upgrading to the latest version of jQuery, has JSON standard changed in latest version (1.4.2).

Here is my JSON:

<?php
if ($_GET['region'] == "Aegean") {
  echo <<<HERE_DOC
[ 
{optionValue: 'Altinkum', optionDisplay: 'Altinkum'},
{optionValue: 'Bodrum', optionDisplay: 'Bodrum'},
{optionValue: 'Cesme', optionDisplay: 'Cesme'},
{optionValue: 'Dalaman', optionDisplay: 'Dalaman'},
{optionValue: 'Dalyan', optionDisplay: 'Dalyan'},
{optionValue: 'Fethiye', optionDisplay: 'Fethiye'},
{optionValue: 'Icmeler', optionDisplay: 'Icmeler'},
{optionValue: 'Gocek', optionDisplay: 'Gocek'},
{optionValue: 'Kusadasi', optionDisplay: 'Kusadasi'},
{optionValue: 'Marmaris', optionDisplay: 'Marmaris'},
{optionValue: 'Oludeniz', optionDisplay: 'Oludeniz'}
]
HERE_DOC;
} else if ($_GET['region'] == "Mediterranean") {
  echo <<<HERE_DOC
[
{optionValue: 'Alanya', optionDisplay: 'Alanya'},
{optionValue: 'Antalya', optionDisplay: 'Antalya'},
{optionValue: 'Belek', optionDisplay: 'Belek'},
{optionValue: 'Kalkan', optionDisplay: 'Kalkan'},
{optionValue: 'Kas', optionDisplay: 'Kas'},
{optionValue: 'Kemer', optionDisplay: 'Kemer'},
{optionValue: 'Saklikent', optionDisplay: 'Saklikent'},
{optionValue: 'Side', optionDisplay: 'Side'}
]
HERE_DOC;
} else if ($_GET['region'] == "Istanbul") {
  echo <<<HERE_DOC
[{optionValue: 'Istanbul', optionDisplay: 'Istanbul'}]
HERE_DOC;
}?>
  • 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-16T22:58:31+00:00Added an answer on May 16, 2026 at 10:58 pm

    You need to wrap your keys in quotes:

    [ 
    {'optionValue': 'Altinkum', 'optionDisplay': 'Altinkum'},
    {'optionValue': 'Bodrum', 'optionDisplay': 'Bodrum'},
    {'optionValue': 'Cesme', 'optionDisplay': 'Cesme'},
    // ... other entries ...
    ]
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm seeing on this site: http://www.modernizr.com/docs/ how they have a decimal list item that
I have replicated a toggle functionality from this site: http://www.williamsprofessionalpainting.com/FAQ.php Here is the updated
From this site: http://www.toymaker.info/Games/html/vertex_shaders.html We have the following code snippet: // transformations provided by
I have nav buttons on this site: http://www.dermatologypartners.com which have rounded corners, a gradient,
I'm trying to get information from this site: http://www.gocrimson.com/sports/mbkb/2011-12/roster If you look at that
On this site http://www.bostonteaclub.com I want the default language to be Chinese. I set
using code from this site: http://www.saltycrane.com/blog/2008/09/simplistic-python-thread-example/ The code is import time from threading import
I stumbled upon this site http://www.swell3d.com/ and I think that in the future we
From this site: http://www.catalinzima.com/?page_id=14 I've always been confused about how the depth map is
I have this site: http://www.problemio.com which currently has a solid-colored background and the body

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.