var answer; var method = ['+', '-', '*']; var operation; //var operation='1+2+3'; // load new operation on page laod new_operation();
My Blog contain Phonegap,CMS related posts. Here I am posting the issues solution that I faced while development and its difficult to find proper solution on other sites. I hope my post will help you with your issues. Developer rocks.
Friday, August 9, 2013
Create Mathematical Validation in Phone
create input, box and operation div in the html file.
write below code in the js file.
Wednesday, July 10, 2013
Get Element Attribute Value using jQuery
Create textarea element to enter html content dynamic
// button click
$('#click_elemtn').click(function(){
var str= $('#html_content').text();
html = $.parseHTML( str ); // parse text to html
$.each( html, function( i, el ) {
var attr = $(el).attr('src'); // attribute name that you want fro the textarea content
if (typeof attr !== 'undefined' && attr !== false) {
alert(attr); // attribute value
}
});
});
you can get attribute value in alert dialog.
refer below URL for live example
http://jsfiddle.net/RNmJ2/
// button click
$('#click_elemtn').click(function(){
var str= $('#html_content').text();
html = $.parseHTML( str ); // parse text to html
$.each( html, function( i, el ) {
var attr = $(el).attr('src'); // attribute name that you want fro the textarea content
if (typeof attr !== 'undefined' && attr !== false) {
alert(attr); // attribute value
}
});
});
you can get attribute value in alert dialog.
refer below URL for live example
http://jsfiddle.net/RNmJ2/
Thursday, May 16, 2013
Add class to link which contains ".pdf" file
Add pdf icon to whole site pdf URLwhich are in the content_area.
In jQuery a[href*=".pdf"]' syntax contains all the elements which link ref contain .pdf
Add specific class to PDF links.
$('.content_area a[href*=".pdf"]').addClass('pdf_doc');
Apply below css to given class to add PDF icon to link to highlight.
.pdf_doc {
background: url("pdf.png") no-repeat scroll left 0;
padding-left: 20px;
background-size: 18px;
}
In jQuery a[href*=".pdf"]' syntax contains all the elements which link ref contain .pdf
Add specific class to PDF links.
$('.content_area a[href*=".pdf"]').addClass('pdf_doc');
Apply below css to given class to add PDF icon to link to highlight.
.pdf_doc {
background: url("pdf.png") no-repeat scroll left 0;
padding-left: 20px;
background-size: 18px;
}
Friday, April 19, 2013
Get File Last Modified Date-Time
<?php
$filename = 'somefile.txt';
if (file_exists($filename)) {
echo "$filename was last modified: " . date ("F d Y H:i:s.", filemtime($filename));
}
?>
this file modify date is used for the mobile application to get updates are available or not on the server file.
this file modify date is used for the mobile application to get updates are available or not on the server file.
Get County from User Lat Long
In Mobile application how the server knows about the posted device country and response then as per the location.
Get the current location of the device and use google map api to get user location. Get location from the ipaddress is a worth thing now. because all the internet user use proxy network.
PHP:
<?php
$cur_lat =$_REQUEST['lat'];
$cur_lon = $_REQUEST['lon'];
Get the current location of the device and use google map api to get user location. Get location from the ipaddress is a worth thing now. because all the internet user use proxy network.
PHP:
<?php
$cur_lat =$_REQUEST['lat'];
$cur_lon = $_REQUEST['lon'];
Labels:
android,
cordova,
cross-domain,
eclipse,
element type,
html,
ios,
iphone,
javascript,
json,
phonegap,
PHP,
plugins,
position,
post data,
xcode
Subscribe to:
Posts (Atom)