Jump to content

ajax data


LeiHa
 Share

Recommended Posts

Hello forum,

I'm here to get a help again.

This time, I'm having a trouble with ajax data.

Sending a data into the same page seems okay.

However, Sending a data into the different page seems not working. I don't know why.

Here is the jquery code.

$.ajax({
	url: url,
	type: 'POST',
	data: { from: 'thispage' },
	success: function(data){
	alert(data);
	}
});

If url is './' I can get this value from $input->post->from

This value returns 'thispage' as expected.

If url is '/different/page' I won't get this value from the above $input->post->from

It seems url has to be a file, Processwire template and page created somehow. Otherwise, it won't be processed because of permission issue.

So, I created template and a hidden page just for the processing ajax.

Any idea what would be wrong?

Thanks.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...