How to fix drupal ajax error - ajax

Hi have create (content type -> Term reference(field))Tag field for drupal web form using Article page.
but i have insert any value ajax error has been show up.
An AJAX HTTP request terminated abnormally.
Debugging information follows.
Path: /file/ajax/field_image/und/0/form-CFfxKDg_mCF4RZ5_tr1-10Nxt--BpZKS6A9w_Jn-Ido
StatusText: n/a
ResponseText:
how to fix this issue.thanks for feature help.

Probably you change your $base_url in settings.php, and your .htaccess has a different url.
For example, if your $base_url is "domain.com" and your .htaccess redirects to "www.domain.com", you may run AJAX errors.

Related

AJAX HTTP request terminated abnormally drupal 7 on node submit

I have a site built in drupal 7 where I use an adding node form which uses ajax for form submission (I use the modal module or the ajax_entity module). In both case when I submit the code the node is not create and I receive the following error in a popup:
"An AJAX HTTP request terminated abnormally. Debugging information follows. Path: http://demo/q=modal/node/add/TestType/ajax/0" Status text:n/a ResponseText:Skip to main content"
I dont if this is important but the node form is divided in vertical tabs and it is opening in modal window. Also it includes textboxes,textareas and file upload field, but in this case still I havent used the file upload fields.
Thanks in advance
Most of the type Drupal Ajax Http error occurs when Drupal cant find Base URL.
So to resolve this issue follow below steps
Set $base_url variable in settings.php
If you have written some custom module, then make sure that whenever you to execute Ajax, check base_url variable have proper value. You can verify base_url value by printing this variable.
I recently had a similar issue and found that someone adjusted the X-Frame-Options in Apache. If you look in the browser's console log, I had this error displaying:
Refused to display 'https://www.example.com/file/ajax/field_heading_background_image/und/0/form-kfxURDN5ZPpN5pjFWajkPCDpMKJrrJthX9WVcY2K8' in a frame because it set 'X-Frame-Options' to 'DENY'.
Adding this to your .htaccess should fix it, but you can also adjust the server configuration:
Header always unset X-Frame-Options
Header set X-Frame-Options SAMEORIGIN

Jmeter: 302 Moved Temporarily

I was trying to issue a https request through jmeter and observed am getting below response.
<html><head><title>302 Moved Temporarily</title></head>
<body bgcolor="#FFFFFF">
<p>This document you requested has moved temporarily.</p>
And it seems the actual url redirecting to different url which is getting the Response Code 200 which is OK. [The first urls response code is 302]
Also I have given an assertion for the page being loaded, but still that assertion fails [when I saw the response data in HTML format, observed that the respective page is not loaded]
Any help in resolving this issue would be a great help.
Looking at: http://jmeter.apache.org/usermanual/component_reference.html#Response_Assertion
If you chose "Main sample and sub samples" it will include the responses from the redirects. So for example if you're searching for "string" it will also include the response from the redirected page.

CodeIgniter returns 404 for all routes but works

I have strange problem with CodeIgniter and routing system and can't find solution for it, so: I have several routes such as
'forum/(:num)'
=> 'forum/category/$1',
'forum/(:num)/(page:any)'
=> 'forum/category/$1/$2',
and them works, but return 404 code in header.
I mean I don't get 404 page, correct HTML returns and page's content displays correctly for my forum's categories. But I'm getting 404 in header (Network tab in Firebug), so I can't work with POST data correctly.
If I request /forum/ - 200 Ok returns, but when I trying to get routed page, I get right page, but with 404 Not Found.
I'm using PHP5.4+Apache2 on Linux host, if it will help You to give me solution.
I've found solution! Maybe it will save someone's time.
Problem wasn't in CodeIgniter, I've found solution in activation mod_rewrite. Yes, that worked, but wan't activated in Apache.
Just try to do
sudo a2enmod rewrite
and restart apache service after
sudo service apache restart
And all routed pages will return 200 Ok
None of these worked, but I did this instead:
At the end of my controller I put this:
$this->output->set_status_header('200');
and actually though that worked, the problem turned out to be a controller name that conflicted with a real directory name...

Codeigniter http request and 404

I have a problem with Codeigniter.
This is my code:
http://pastebin.com/scccVP8D
If my url is: example.com/validator/validator/value/323445
Http request response:
323445
404 Page Not Found
The page you requested was not found.
Why do i get an error 404?
I don't see value/323445 anywhere in your code. You just have function validator without any parameter.
So, when you call example.com/validator/validator/value/323445 the page don't egsist.
You need to delete parameter or to add parameter in function and to use it.

xhrPost : from an http view to an https url

using Dojo, is it possible to make an Ajax call using xhrPost from an HTTP view to a HTTPS url ?
The url must be HTTPS (as defined in Struts).
If I simply set "MyCommand" as the 'url' parameter of the xhrGet, I get a 302 error code.
If I transform "MyCommand" using javascript to something like "https://......./servlet/MyCommand" I see the following error in Firebug : "uncaught exception: Permission denied to call method XMLHttpRequest.open".
I'm stuck using both approaches, the only solution I found is to remove the "https" clause in the struts configuration file, and of course this is not a correct solution :)
Thanks for any help.
Best regards,
Nils
connection to https from http involves a different port of the target. This violates the same-origin policy which should be enforced by the browser to the running javascript code.
It should work with an iframe..
dojo.io.iframe encapsulates this behaviour for you
http://docs.dojocampus.org/dojo/io/iframe
If your server responds with a redirect to a non-ssl (correctly to same-origin) page you should be able to read the response (because the iframe is now in the same-origin).

Resources