Category : Javascript


How can i print php variable in jquery?

If you are working on php and you need to print your php variable inside the javascript then you can simple get value. you can use "" for get value of php variable. in following example you can see : <strong>Example:</strong> <pre class="code language-html"> <script type="text/javascript"> var my_var = "<?php echo $my_variable; ?>"; console.log(my_var); </script> OR <script type="text/javascript"> var my_var = <?php echo $my_variable; ?>; console.log(my_var); </script> </pre> But, you can use on php file, Not on js file.

By Hardik Savani | February 8, 2016 | | 1118 Viewer | Category : Javascript
READ MORE

Select only one checkbox at a time using Jquery

If you need to select one checkbox at a time in multiple checkbox, i mean you want to allow anly one checkbox user can check then you can do easily using jquery. jquery prop() through you can give attribute value checked equel to true or false. if you have banch of checkbox like as example, and if you want to check checkbox at time one by using jquery then you can use this code. In following example use for you to do select at a time one. <strong>Example:</strong> <pre class="code language-html"> <html> <head> <title>Select only one checkbox at time</title> <scri.....

By Hardik Savani | February 5, 2016 | | 11725 Viewer | Category : Javascript
READ MORE

How to check undefined, empty and null in JavaScript/JQuery ?

If you are working on jquery and However you want to check variable is undefined or not then you can easily check by typeof operator, which is simple, fast and cross-platform: <pre class="language-javascript"> if(typeof i == "undefined"){ alert('undefined'); } </pre> If you are working on jquery and However you want to check variable is empty or not then you can easily check by compare with empty string: <pre class="language-javascript"> if(i == ''){ alert('Empty'); } </pre> If you are working on jquery and However you want to check variable is null or not then you can easily che.....

By Hardik Savani | January 12, 2016 | | 715 Viewer | Category : Javascript
READ MORE

How to convert line breaks to br in jQuery ?

If you are use textarea and you want to like break into br(\n) so that way we can give format as user insert, but if you are working on php then you can easily doing with nl3br() through, but if you are using in jquery or javascript then you have to first declare that. i did give full example of jquery textarea line breaks as under. <pre class="code language-html"> <body> <textarea class="textareac"></textarea> <script> var text_content = <?php echo $content ?>; function nl2br (str, is_xhtml) { var breakTag = (is_xh.....

By Hardik Savani | January 9, 2016 | | 1037 Viewer | Category : Javascript
READ MORE

How to check Object is empty or not in Jquery/JavaScript ?

you can check your JavaScript OR jQuery object is empty or not, because we need to check many place our jQuery object is empty, null or undefined etc., So usually, we can check using $.isEmptyObject() as i explained as under. how to check empty object in javascript, how to check empty object in jquery, jQuery.isEmptyObject() example, jquery check object is null, jquery check object is empty, jquery check object is empty or not, how to check json object is empty or not in jquery, check if json object is empty jquery <pre class="language-javascript"> if($.isEmptyObject(your_object)){ alert(.....

By Hardik Savani | January 8, 2016 | | 14302 Viewer | Category : Javascript
READ MORE

How to get Lat and Lon from google map API in Jquery PHP?

if you are working on php, asp or any other framwork and you want to integrate google API and also you want to get Latitude and Longitude for location. we have mostly fetch some problem when we set google map because i tried and i also fetch problem. but i am giving you with search location and get Latitude and Longitude of that location. you have to use html file, css file and js file as i write under and use them in your system. first you have to create simple html file. so create folder in your system and create new index.html file and copy index.html file as i give you under. <strong>Inde.....

By Hardik Savani | January 6, 2016 | | 2271 Viewer | Category : Javascript
READ MORE

    How to get filename from file path in MySQL?

    How to get filename from file path in MySQL?

    Open Post

    How to make read more link from string in PHP?

    How to make read more link from string in PHP?

    Open Post

    Laravel 5.4 - send email using Markdown Mailables

    Laravel 5.4 - send email using Markdown Mailables

    Open Post

    Jquery - Animated typing effect using typed js example with demo

    Jquery - Animated typing effect using typed js example with demo

    Open Post

    Simple PHP Jquery Ajax CRUD(insert update delete) tutorial example with source code

    Simple PHP Jquery Ajax CRUD(insert update delete) tutorial example with source code

    Open Post

    How to connect mysql database in node js with example?

    How to connect mysql database in node js with example?

    Open Post