Alright! After about 20 hours of research, I found the answer in a
blog by Ryan Pharis (link above). As I was suspecting, it was an easy
solution.

Wordpress is using "user friendly URLS". Therefore my path ended up
like this: http://www.mysite.com/includes/autosuggest.php?json=true&;

The REAL path is this: 
http://www.mysite.com/wp-content/themes/my_theme/includes/autosuggest.php?json=true&;

My script cannot be located in an external .js script, because I need
to get the URL from Wordpress. So I did this:
<?php $site_url = bloginfo('template_url'); ?>

 <script type="text/javascript">
    var options = {
        script:"<?php echo $site_url; ?>includes/autosuggest.php?
json=true&",

Now my script works and I'm a happy camper.

Reply via email to