Categories
Mastering Development

why does jQuery callBack handler returns [object Object]

I built a SessionMgr.cfc <cffunction name=”jgetValue” access=”remote” returntype=”string” output=”yes” returnFormat=”json”> <cfargument name=”variablename” type=”string” required=”yes”> <cfset var result = 0> <cfset result = Evaluate(“session” & “.” & arguments.variablename)> <cfset var ReturnValue = result /> <cfreturn result /> </cffunction> in coldfusion to set/get session variables to run all my $.ajax calls, And I seem to be doing […]

Categories
Development

Calling ajax several times result a duplicated response

I created an ajax function that returns my items Price by fetching from my DB. I’m sure there isn’t any problem with my php but sometimes I get the same result twice! jQuery $(‘.removemore___’).click(function(e) { var item_id = $(this).attr(‘data-item’); var col_id = $(this).attr(‘data-col’); var value = $(this).attr(‘data-value’); if ($(this).attr(‘data-trash’) == ‘trash’) { newPopuper(‘alert_sure__’, ‘flex’, ‘blackScreen’); […]

Categories
Development

Save generated PDF file on the server with jsPDF and PHP

I’m trying to save the generated PDF file with JSPDF plugin into the server instead of being saved on the client side, the javascript part that handles the JsPDF is this: <script type=”text/javascript”> (function(){ var form = $(‘.form’), cache_width = form.width(), //cache_height = form.height(), a4 =[ 595.28, 841.89]; // for a4 size paper width and […]

Categories
Development

exporting jqgird data when loadonce set as false

I have a simple grid, when page loads I get all the data by default and also I have ajax post function to search same data with Id.My issue is when the page loads firstime and if I try to export default data, my excel is empty with only name of columns. However if i […]

Categories
AJAX Development jQuery

Why jquery ajax post request get error in yii2?

js: $.ajax({ url: ‘/site/updateuserdata’, method: ‘POST’, //async: true, //cache:false, data: { ‘type’: ‘sort’ //val: val //csrfParam: csrfToken }, dataType: ‘text’, error: function(jqXHR, textStatus, errorThrown) { alert(‘error by ajax’); }, success: function(data, status, jqXHR) { alert(‘success by ajax’); } }); Controller: public function behaviors() { return [ ‘access’ => [ ‘class’ => AccessControl::className(), ‘rules’ => [ […]

Categories
Chrome Development jQuery PHP

Jquery .addClass() function doesn’t work in chrome but it works fine in Mozilla

i want to add class to my input tag using addClass method in jquery but its not working in chrome !!! ` $(‘#username-signup’).blur(function() { var tempusername = $(‘#username-signup’).val(); $.ajax({ type: “POST”, url: “includes/identification.php”, data: { username: tempusername }, dataType: “text”, success: function(response) { //console.log(‘success’); if (response == ‘n’) { //console.log(‘n’); $(‘#username-signup’).removeClass(‘identication-y’); $(‘#username-signup’).addClass(‘identication-n’); } else { […]

Categories
AJAX Development jQuery Website

I can’t fetch student marks website using ajax

I’m trying to fetch this site http://secondary2019.moed.gov.sy/literary/result.php I wrote this code as ajax: $.ajax({ url: “http://secondary2019.moed.gov.sy/literary/result.php”, method: “POST”, dataType: ‘text’, data: { city: 10, stdnum: 1516, }, success: function(data) { var obj = $.parseJSON(data); console.log(obj); } }); <script src=”https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js”></script> But no effect. Any way to fetch it ? Note : I wrote a php fetch […]

Categories
Development

AdMob Pro “admob.rewardvideo.events.REWARD” is not fired

i made my Cordova App for Android. Now I’m trying to insert monetization with AdMob Pro, banner and interstitial are ok, the reward video is loaded and shown but after i have saw the video the event admob.rewardvideo.events.REWARD is not fired but instead is called the function $(document).on(‘onAdDismiss’, function(e){}); I can’t understand why!! O the […]

Categories
Development

How to make a controller to get a URL with HashMap?

I need to make a controller in Spring Boot 2.0 to get correctly an URL like this: https://localhost:8443/my_generate_signature?data%5Btimestamp%5D=1570074358&data%5Bsource%5D=uw This URL is being called by an AJAX requisition: <script type=”text/javascript”> var generateSignature = function(callback, params_to_sign){ $.ajax({ url : “/my_generate_signature”, type : “GET”, dataType: “text”, data : { data: params_to_sign}, complete: function() {console.log(“complete”)}, success : function(signature, textStatus, […]

Categories
AJAX Development jQuery

Related Select Dropdowns (CF and Ajax/jQuery) – Getting an error in the second dependent dropdown when selecting the first dropdown option

I am getting an error in the second dropdown when I select an option in the first dropdown menu. I am using Coldfusion / MS SQL for the form and data. The SQL query is correct as a cfdump shows the correct values I need. The ajax/jquery seems to kind of work as it does […]