Categories
Mastering Development

Php file is not responding to Ajax success function

I am new to PHP. I am trying to make ajax success function should display in the alert box the JSON of the PHP file. Here is the HTML file that has Ajax in it <html lang=""> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function(){ $("button").click(function(){ $.ajax({ url:"index.php", type:"post", data:{"name":"waqar","email":"abc@xyz.com"}, success:function(res) { alert(res); } }); }); }); </script> […]

Categories
CMS Joomla Mastering Development

not able to do ajax request in my custom component i’m not working in mvc right now

My ajax request is not working i’m passing url of my components file here option = com_jumi this is my custom component and fieldid =44 is where my php insert into databse operation is there but it is not working. I have gone through different answers like https://docs.joomla.org/J3.x:Developing_an_MVC_Component/Adding_AJAX but in here it tell about mvc. […]

Categories
Mastering Development Software

how to send real time base64 from canvas to server with ajax?

i’m new in web developing. i want to send a live webcam streaming from client side to the server which will be used for face recognition process. i tried to use ajax, but it return 405 method not allowed in console. does anyone has a solution for this ? i really need it. thank in […]

Categories
Mastering Development

Ajax call console’s correct number, but php shows null

I have looked at many the same question on stackoverflow and just can’t figure out why my php is showing null instead of the number. I have this php: <?php $message .= “<br /><b>Beneficiaries:<b><br />\n\n”; $message .= “\n” . $_REQUEST[‘clickCount’] . “\n\n\n”; $benmax = 4; $var =json_encode($_GET[‘clickCount’]); echo $var; ?> Then lower in my page […]

Categories
CMS Development Wordpress

How to use Datatable with Ajax when creating plugin on WordPress?

Hello i wanted to make a plugin with DataTable integration but i have a problem on calling ajax in url. this is my plugin directory look like. in index.php i use admin_enqueue_scripts for datatable CDN. page_handler.php handle page html. cdt.js where my customize js & jquery. usually in DataTable if we don’t use WordPress, u […]

Categories
CMS Development Wordpress

How to use Datatable with Ajax when creating plugin on WordPress?

Hello i wanted to make a plugin with DataTable integration but i have a problem on calling ajax in url. this is my plugin directory look like. in index.php i use admin_enqueue_scripts for datatable CDN. page_handler.php handle page html. cdt.js where my customize js & jquery. usually in DataTable if we don’t use WordPress, u […]

Categories
CMS Development Wordpress

How to use Datatable with Ajax when creating plugin on WordPress?

Hello i wanted to make a plugin with DataTable integration but i have a problem on calling ajax in url. this is my plugin directory look like. in index.php i use admin_enqueue_scripts for datatable CDN. page_handler.php handle page html. cdt.js where my customize js & jquery. usually in DataTable if we don’t use WordPress, u […]

Categories
Development

Can’t get Modal window to submit POST Ajax

I’m trying to get the following ajax to send POST data to my other script. When looking at the headers in Dev Tools, it doesn’t show them. Where am I going wrong? $(‘#createUserBtn’).click(function(e){ e.preventDefault(); $.ajax({ url:’signup.php’, type:’post’, data:$(‘#createUser’).serialize(), success:function(){ toastr.success(“User successfully added!”); }, error: function(){ toastr.warning(‘Uh-oh! Something went wrong with adding this user!’); } }); […]

Categories
Development

Ajax, Flask route, data appended to URL, server error

I’m using a Flask route to update a MYSQL database and I use an AJAX call to trigger this event. Whenever I run the webpage, I get an internal server error because it appends ?bet=1 to my url [and the is not a defined url]. I don’t really get what I have to do to […]

Categories
Development

Trigger click event to dynamically added link on href using jquery

I am dynamically creating the link on anchor tag through jquery, I want to trigger click event as soon as link gets attached to href, but in my case click event didn’t get triggered. JQuery: $(“#refShare”).click(function(e){ jQuery.ajax({ url: base_url+”create-refer”, cache : false, dataType: ‘json’, data: { email:email }, type:’post’, success:function(response){ jQuery(‘li#refShare a:first’).attr(“href”, ‘https://www.xyzLink.com/’+response.link); jQuery(‘li#refShare a:first’).attr(“target”, […]