tags:

views:

52

answers:

2

Hello all,

I have the following code:

<script type="text/javascript">
  $(function() {
    $('#bootChooserControl')
      .load('/jqia2/action/fetchBootStyleOptions');

    $('#bootChooserControl').change(function(event){
      $('#productDetailPane').load(
        '/jqia2/action/fetchProductDetails',
        {style: $(event.target).val()},
        function() { $('[value=""]',event.target).remove(); }
      );
    });

  });
</script>

My question is that why it doesn't work for me if I change load('/jqia2/action/fetchBootStyleOptions') to load('/jqia2/action/fetchBootStyleOptions.php')

The same problem happens for fetchProductDetails.

Thank you.

+1  A: 

Barring the fact that you're just pointing to invalid files by adding the .php (try navigating manually by putting 'window.location = "/jqia2/action/fetchBootStyleOptions.php"; in your function and see if it pulls up) you may be having an issue with MultiViews, check your .htaccess and you can also check out http://httpd.apache.org/docs/1.3/content-negotiation.html

Robert
Hello all,I have found the content of this file .htaccess////////////////////////////////RewriteEngine on# /action/xxx -> /chapter8/bootcloset/actions/xxx.phpRewriteRule ^action/(.*) /jqia2/chapter8/bootcloset/actions/$1.php [L]///////////////////////////////////////////////Does this cause the problem?thank you
q0987
By removing all statements inside .htaccess doesn't solve this issue.thank you
q0987
Have you tried the other part, having your script redirect you to that path.
Robert
Hello Robert,This is aJax call. I don't know how I can use window.location = "/jqia2/action/fetchBootStyleOptions.phpand put it inside load function.best wishes
q0987
change your code to: `$('#bootChooserControl').change(function(event){` ` window.location.href='/jqia2/action/fetchBootStyleOptions.php';` `});`
Robert
+1  A: 
/jqia2/action/fetchBootStyleOptions 

is being rewritten by the .htacccess rule to

/jqia2/chapter8/bootcloset/actions/fetchBootStyleOptions.php

so if you would like to call it directly, you could use

load('/jqia2/chapter8/bootcloset/actions/fetchBootStyleOptions.php')
Shuja Shabandri