You could post it to a scripting file (php etc) then have that forward
the post onto the correct page, but don't use a variable in the JQuery
code for the forwarding page for obvious security issues.

On Dec 10, 9:11 am, MorningZ <morni...@gmail.com> wrote:
> if
>
> http://<<< domain where AJAX call is made from>>>
>
> is different than
>
> http://<<< domain where AJAX call is made to>>>
>
> even if it's just a "sub"-domain, it is not going to work as you are
> breaking the cardinal rule of browsers:  client side script cannot
> call another domain like this
>
> doesn't matter what the sub-domain is, how it was created, if
> it's"psudeo", ** just that it's different **
>
> On Dec 10, 11:51 am, Pj <pravee...@gmail.com> wrote:
>
> > Hi there,
> > I've configured mod_rewrite rules to have pseudo sub domains for
> > pages.
>
> > I discovered that when i try to send a $.post() request to an absolute
> > path, the function() which needs to be executed after a successful
> > $.post, doesn't execute. In my code, it stays at "Please wait... "
> > stage.
>
> > After doing some tests i found out post values are not passed into the
> > target php script.
>
> > Also I found out sessions are not working in the target script.
>
> > Can't i use jquery's $.post() method for pseudo subdomains?
> > (this works perfectly in the actual page though)
>
> > Here's my code.
>
> >  function addContact(id){
>
> >    $(document).ready(function(){
> >                 $("#add-con-ok"+id).html("Please wait... <img 
> > src='images/loading-
> > small.gif'>");
> >                 $.post("http://domain.com/add-contact.php";, { id: id}, 
> > function(){
> >                                                                             
> >               $("#add-con-ok"+id).html("<small>Request Sent</
> > small>").animate({ opacity: "hide" }, 2000);
> >                                                                             
> >               });
> >         $("#add-con-box"+id).hide();
>
> > });
> > }
>
> > backend:
>
> > <?php
> > session_start();
>
> > if(isset($_SESSION['USER_ID'])){
>
> >         $c_id = mysql_real_escape_string($_POST['id']);
> >         //rest of the code}
>
> > ?>

Reply via email to