jQuery Ajax – send all fields data by “POST”
jQuery Ajax – send all fields data by “POST” jQuery.ajax({ data: jQuery(‘#formId’).serialize(), // etc.. }
jQuery Ajax – send all fields data by “POST” jQuery.ajax({ data: jQuery(‘#formId’).serialize(), // etc.. }
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent vel enim erat, nec luctus mi. Integer id dolor a erat commodo imperdiet. Vivamus nec odio nibh, ut lobortis metus. Nunc rhoncus nunc augue. Suspendisse vitae justo nunc. Etiam tempor sagittis porta. Maecenas nec volutpat quam. Cras eget libero felis, ut fermentum odio. Quisque in tellus
PHP simple SOAP sample SOAP server file (soapserver.php): <?php // Set a function in SOAP server file function hello($someone) { return “Hello ” . $someone . “!”; } // Create a new SOAP server $server = new SoapServer(null, array(‘uri’ => “urn://g31.local/ex/res”)); // Add function to SOAP server $server->addFunction(“hello”); // Handle SOAP server $server->handle(); ?> SOAP
Redirect from www. to non www RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC] RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
Edit Apache Config The file is located “c:xamppapacheconfextrahttpd-vhosts.conf”: Add this lines if not already exists: <VirtualHost 127.0.0.1:8080> DocumentRoot C:/xampp/htdocs/ ServerName localhost ServerAdmin admin@localhost </VirtualHost> Then add the following to have “c:xampphtdocssub.domain.com” point to http://sub.domain.com.localhost/: <VirtualHost subdomain.localhost> ServerName localhost ServerAdmin webmaster@localhost DocumentRoot /home/httpd/htdocs/subdomain/ ServerAlias subdomain.localhost </VirtualHost> Edit HOSTS File You can find your HOSTS file in
Print array elements with javascript: var output = ”; for(var i=0; i < arr.length; i++){ output += "arr[" + i + "] = " + arr[i] + ";"; } alert(output); Print object with javascript: var output = ''; for (property in object) { output += property + ': ' + object[property] +'; '; } alert(output);
The syntax of the window.open: open (URL, windowName[, windowFeatures]) example: window.open (“http://www.g31zone.com”,”G31zone”); window.open (“http://www.g31zone.com”, “G31zone”,”status=1,toolbar=1″); Parameters: status The status bar at the bottom of the window. toolbar The standard browser toolbar, with buttons such as Back and Forward. location The Location entry field where you enter the URL. menubar The menu bar of the window
Verify if a checkbox is selected (checked) with jQuery <form name=”my_form_name” id=”my_check_box”> <input type=”checkbox” name=”my_check_box” id=”my_check_box”> </form> <script type=”text/javascript”> jQuery(document).ready(function() { jQuery(‘#my_check_box’).click(function () { if (jQuery(this).is(‘:checked’)) { alert(‘My checkbox is checked’); } } } </script>
Method to prevent form submitting using jQuery: <form method=”post” name=”my_form_name” id=”my_form_id”> <input type=”submit” value=”Go”> </form> <script type=”text/javascript”> jQuery(‘#my_form_id’).submit(function() { alert(‘Prevent form submitting.’); return false; }); </script>
Javascript – limit the number of characters in a textarea: <script language=”javascript” type=”text/javascript”> function limitText(fieldLimit, countLimit, limitNum) { if (fieldLimit.value.length > limitNum) { fieldLimit.value = fieldLimit.value.substring(0, limitNum); } else { countLimit.value = limitNum – fieldLimit.value.length; } } </script> <form name=”form_name”> <textarea name=”sometext” onKeyDown=”limitText(this.form.sometext,this.form.counter,100);” onKeyUp=”limitText(this.form.sometext,this.form.counter,100);”> </textarea><br /> (Maximum characters: 100)<br /> You have <input readonly type=”text”