Uncategorized

jQuery Ajax php with resposive json data

1 HTML and JS code   <html> <head> http://jquery.min.js </head> <body> <form action=”#” method=”POST”> <label>First name:</label><br> <input type=”text” class=”firstname” name=”firstname” value=””> <br> <label>Last name:</label><br> <input type=”text” class=”lastname” name=”lastname” value=””> <br><br> <input class=”submit” type=”button” value=”Submit”> </form> </body> </html> function submitAjax(){ jQuery(‘.submit’).click(function(){ var data = new FormData(); data.append(‘firstname’, jQuery(‘.firstname’).val()); data.append(‘lastname’, jQuery(‘.lastname’).val()); data.append(‘action’, ‘nameFunction’); jQuery.ajax({ type: “POST”, url:… Continue reading jQuery Ajax php with resposive json data

Uncategorized

JQuey ajax log data of html selector

function submitAjax(){ var data = new FormData(); data.append( ‘delete_all’, jQuery(‘.delete_all’).val()); data.append( ‘clean_stagging’, jQuery(‘.clean_stagging’).val()); jQuery.ajax({ type: “POST”, url: jQuery(location).attr(‘href’), contentType: false, processData: false, data: data, beforeSend: function(){ jQuery(‘.container’).html(‘<p style=”color:green;font-size:30px;”>Processing…</p>’); }, success: function(data){ var oneval = jQuery(‘.result’,data).val(); if(oneval == 1){ jQuery(‘.container’).html(‘<p style=”color:green;font-size:30px”>Success</p><br><a href=”javascript:history.back()”>Go Back</a>’); }else{ jQuery(‘.container’).html(‘<p style=”color:red;font-size:30px”>Failed</p><br/><a href=”javascript:history.back()”>Go Back</a>’); } }, error: function(){ jQuery(‘.container’).html(‘<p style=”color:red;font-size:30px”>Failed</p><br/><a href=”javascript:history.back()”>Go Back</a>’);… Continue reading JQuey ajax log data of html selector

Uncategorized

wordpress fix page 404 not found when chang permalink

In class-wp.php in include folder public function query_posts() { global $wp_the_query; $this->build_query_string(); // var_dump($this->query_vars);die(‘zzz’); if($this->query_vars[‘name’] == ” && !empty($this->query_vars[‘product_cat’])){ // var_dump($this->query_vars);die(‘zzz’); $queried_post = get_page_by_path($this->query_vars[‘product_cat’],OBJECT,’post’); if(!empty($queried_post)){ $this->query_vars[‘name’] = $this->query_vars[‘product_cat’]; $this->query_vars[‘product_cat’] = ”; } } $wp_the_query->query($this->query_vars); }