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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T08:14:11+00:00 2026-06-17T08:14:11+00:00

I have 2 (local) subdomains: kohana.local.com and wordpress.local.com . jQuery plugin (.js) is located

  • 0

I have 2 (local) subdomains: kohana.local.com and wordpress.local.com. jQuery plugin (.js) is located on kohana.local.com domain and takes care of rating articles and retrieving rate count on both domains. Controller_Rating extends Controller. Method (action_getrating) has following code (kohana 3.2):

if($this->request->post() && $this->request->is_ajax()){
    $this->auto_render = FALSE;
    echo "{$_REQUEST['callback']}(".json_encode($data).")";
}

Ajax call:

$.ajax({
    type: "POST",
    url: "http://kohana.local.com/rating/getrating",
    dataType: "jsonp",
    data: { some_id: id },
    success: function(json){
            //do something
    }
});

When ajax call gets issued from kohana.local.com, everything works great. If it’s issued from wordpress.local.com $this->request->is_ajax() is false, and method is not “post”, but “get” somehow. What is the reason for this, and how to make it work? Post is required and is_ajax is good for security and validation.

Thanks in advance.

EDIT:
post to jsonp is not possible, so i can’t use this approach. i’ll have to try to find the solution in the direction of json

  • 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-17T08:14:12+00:00Added an answer on June 17, 2026 at 8:14 am

    You can simply use json dataType, so you don’t need to use callbacks. Just add header Access-Control-Allow-Origin to server which requests are made (kohana.local.com).

    All domains are allowed:

    Access-Control-Allow-Origin: *
    

    Or specify allowed domain:

    Access-Control-Allow-Origin: http://wordpress.local.host
    

    Spec: http://www.w3.org/TR/2008/WD-access-control-20080912/#access-control-allow-origin


    Multiple domain solution: Access-Control-Allow-Origin Multiple Origin Domains?

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

Sidebar

Related Questions

I have a local build of my site running at local.mydomain.com. I'm making ajax
I have a PHP script on a domain (say example.com) and this domain has
I have the domain example.com and the test.example.com running on apache server. For some
I am have a web application on local IIS (mylocalsite.com) What settings I need,
I have two domains: test.local editor.test.local User signed up on domain test.local and browser
I have local data in a grid. How can I get all of the
I have local server for my site (i made it with XAMPP). How can
I'm working on a project with couple others. We all have local copies of
I have a local Database running on localhost:3306, which I access with MySQL Workbench.
I have a local git repo, and I have a remote git repo. What

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.