Problem with Jquery and Ajax

My url is http ://amazoindia.great-site.net/admin/dashboard.php
Username: 6760
Pass : 0000
(Please check the problem)

Like my page is ‘dashboard.php’ where data load through ajax. and ajax script is–

$.ajax({
url : “second.php”,
type : “POST”,
data : “abc : abc”,
success : function(result){
$("#div1").html(result);
}
})

After data load through jquery and ajax webpage auto redirects to these ‘second.php’ file/page. And page turned into blank.so if i open ‘dashboard.php’ it redirects to ‘second.php’ file within 1/2 second after page load. If i removed jquery and ajax file then not redirect. And this problem not found in xammp server.

I have load the maximum data through jquery ajax. After load the webpage data is show in page but after 1 sec. Page redirects to blank php file/page where i send/requst for data through ajax. But if i go in another page where not apply jquery/ajax like log in page it has no any problem… That problem doesnot happen in xammp server, happens only in this server.

Why this problem?

Welcome!

Everything looks OK to me. Try clearing your cache. The only thing I can think of is maybe the browser is blocking it because there is no SSL certificate. Try using a different browser.

2 Likes

I have check the problem by clear cache and browser data again and again… Sometime it looks ok, it run with no problem… you can check by refresh the page and click on other option. Try it for 2-3 min continiue

I have tried with different browser looks the same problem

Because you need to install an SSL certificate.

1 Like

Many browsers nowadays block POST requests if you’re not using HTTPS, or at least show warnings, because the data you’re submitting through POST can be read relatively easily by attackers.

You don’t get this issue in XAMPP, because these security constraints are not enforced for localhost, because that’s normally a development system where you can’t get HTTPS and no real data is transferred over the internet.

I think that this isn’t a problem that only happens in our server, I think it’s more likely that this problem happens everywhere that’s not XAMPP.

So installing an SSL certificate is definitely the way to go I think.

4 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.