Posts

Showing posts with the label jquery

How to get the value of jquery response in a variable in jquery or call back function

How to get the value of jquery response in a variable in jquery and how to use call function. $('#datajquery').load('<?php echo $this->baseUrl ?>/yourpage.php',{ 'b_askprice1':b_askprice1}, function(data){ if(data != 'No result Found!'){ window.location.href = data; }else{ $('#filter_result').html(data); } }); in this code data will return you the response value via jquery and #filter_result is a id where you want to display your data and #datajquery is a hidden field id where you response data will be save to check the value

How To get the url of last page in php?

In php to find the url of last page on a current page. You should use “$_SERVER['HTTP_REFERER']” $lastPageUrl = $_SERVER['HTTP_REFERER'];

load() – jQuery API or how to use load function of jquery?

$('#likediv').load('ajax/like-updates.php',{ 'category':cat ,'type_id': typeid,'user_id': userid}); Example : function likeEvent(cat,typeid,userid) { $('#likediv').load('ajax/like-updates.php',{ 'category':cat ,'type_id': typeid,'user_id': userid}); } Note:   #like => div is a id of div where you will want to show your data. load => is a function where we gave path of a file where calculation takes place. { 'category':cat ,'type_id': typeid,'user_id': userid} => in braces we pass the parameter like there are passing 3 parameter Finally we can call a this function on any event