Hiren Kukadiya

How to add Chosen after add more element

Remove chosen from added element. $(“#masterCats_chzn”).remove(); Remove and add new class for added element. $(“#masterCats”).css({display: “inline-block”}).removeClass(“chzn-done”).addClass(“chsn“); Initialize chosen. $(“.chsn“).chosen();Read more …
Hiren Kukadiya

Print HTML to PDF

$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, “https://api.printfriendly.com/v1/pdfs/create”); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, “html='<html><body><h1>Title</h1><p>Text“); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_USERPWD, “4ad92b944e0de703b54b2076f4efdabe” . “:” . “”); $headers = array(); $headers[] = “Content-Type: application/x-www-form-urlencoded”; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $result = curl_exec($ch); if (curl_errno($ch)) { echo ‘Error:’ . curl_error($ch); } curl_close ($ch); echo “</br>Result</br>”; print($result);die; For the...Read more …
Hiren Kukadiya

Broken Images issue in browser

When not get any images from Db or Folder then display broken images in page. if we not display that broken images on page then use below code…. <img src=“someimage.jpg” onerror=“this.style.display=‘none’;“ />Read more …
Hiren Kukadiya

Page redirect issue with link

When click on <a href=””> link then page should redirect on another page but when we don’t want redirect page on click <a href=””> then use below code : $(‘.class a’, ‘click’, function(e) { e.preventDefault(); { Your code } });  Read more …
Hiren Kukadiya

Cakephp Pagination Issue

When Set Pagination in Cakephp we can use costume url for the pagination path. By default path is : page url   $this->renderElement( ‘cake_pagination’, array( ‘model’ => $model, ‘paging’ => array_merge( $this->params[‘paging’][$model], array( ‘url’ => array(‘controller’ => ‘Pages’, ‘action’ => ‘all_messages_data’), )), ));Read more …