Friday, 1 January 2016

jQuery Mobile interview questions and answers

jQuery mobile interview questions and answers

jQuery Mobile is a UI framework which is written in javaScript language and used for creating mobile web applications. It works on all popular smartphones and tablets. jQuery Mobile uses HTML5 & CSS3.



What is Initial release of JQuery Mobile?
October 16, 2010


Question: What is Latest version of jQuery Mobile?
Version: 1.4.5
Dated: October 31, 2014


Question: In which language, jQuery mobile is written?
JavaScript


Question: Where it is used?
It is "Mobile application framework" which is used for creating mobile web applications.


Question: What is offical website of jQuery Mobile?
http://jquerymobile.com/


Question: What are Features of jQuery Mobile?
  • Compatible with all major desktop browsers as well as all major mobile platforms (Android, iOS, Windows Phone, Blackberry, WebOS, Symbian)
  • Built on top of jQuery core.
  • Lightweight to optimize speed.
  • The same underlying codebase will automatically scale to any screen.
  • HTML5-driven.
  • AJAX-powered navigation with animated page.
  • UI widgets



Question: Why Use jQuery Mobile?
1. Write Less, Do more
2. Its works on Android, Blackberry, iOS and Iphone
3. Its optimized


Question: Describe few HTML tags used in jQuery Mobile?
data-role="page": Page displayed in the browser.
data-role="header": Creates a toolbar at the top of the page.
data-role="main": Content of the page, like text, images, buttons and forms etc.
"ui-content": Adds extra padding and margin inside the page content
data-role="footer": creates a toolbar at the bottom of the page


Question: How to Add Back Button?
<a class="ui-btn" data-rel="back" href="https://www.blogger.com/blogger.g?blogID=5911253879674558037#">Go Back</a>


Question: What is jQuery Mobile Themeing?
jQuery Mobile provides a powerful theming that allows developers to customize color schemes & CSS aspects of UI features.


Thursday, 31 December 2015

Zend Framework 2 Json Model understanding

Zend Framework 2 Json Model understanding


Question: How to render JSON response?
In controller use, JSONModel
public function indexAction()    {
        $result = new JsonModel(array('data'=>array(
     'key1' => 'value1',
     'key2' => 'value2',
     'key3' => 'value3',
     'key4' => 'value4',
     'key5' => 'value5'
            
        )));

        return $result;
    }

In View file, use following the encode the array.
echo Zend\Json\Json::encode($this->jsonArray, Zend\Json\Json::TYPE_ARRAY);



Question: How to JSON Encode an php object in recursive way?
$arrayData = Zend\Json\Json::encode($phpObject, true);



Question: How to convert XML to JSON?
$jsonContents = Zend\Json\Json::fromXml($xmlStringContents, true);



Question: How to get PHP Array from JSON Encoded string in view file?
$encodedValue='[1,2,3,4,5,6]';
$arrayData = Zend\Json\Json::decode($encodedValue,Zend\Json\Json::TYPE_ARRAY);
print_r($arrayData );die;


Question: How to get PHP Object from JSON Encoded string in view file?
$encodedValue='[1,2,3,4,5,6]';
$arrayData = Zend\Json\Json::decode($encodedValue,Zend\Json\Json::TYPE_OBJECT);
print_r($arrayData );die;



Question: How to display JSON Encoded string in Pretty way?
$encodedValue='[1,2,3,4,5,6]';
$arrayData = Zend\Json\Json::prettyPrint($encodedValue, array("indent" => " "));
print_r($arrayData );die;



Question: How to check Ajax Request OR Not?
if($this->getRequest()->isXmlHttpRequest())){
/** 
This is Ajax Request 
**/
}else{
/** 
This is NOT Ajax Request 
**/
}