This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ajax = isset($_SERVER['HTTP_X_REQUESTED_WITH']) && | |
$_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$string = 'first@mail.ru=From first||second@mail.ru=From second'; | |
$mails = explode('||', $string); | |
$to = array(); | |
foreach ($mails as $mail) { | |
list($key, $value) = explode('=', $mail); | |
$to[trim($key)] = trim($value); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function () { | |
/*************** FIRST EXAMPLE *********************/ | |
$.ajaxSetup({ | |
beforeSend: function() { | |
$('#general-ajax-load').fadeIn(); | |
}, | |
complete: function() { | |
$('#general-ajax-load').fadeOut(); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>[[++site_name]] - [[*pagetitle]]</title> | |
<base href="[[++site_url]]" /> | |
<style> | |
body {margin:auto; width:800px; color: #5F5F5F;} | |
</style> | |
</head> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($){ | |
var requests = {}; | |
$(function(){ | |
// Determine which data you need and call the getData()... | |
// Stubbing in some example data... | |
// This is a unique request and would make an ajax call | |
getData({ | |
foo: 'bar' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.when( | |
$.ajax('ajax.php') | |
).then(function(data){ | |
// Here I can work with data like I would with a regular ajax request | |
alert($(data).find('mynode').text()); | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* SplClassLoader implementation that implements the technical interoperability | |
* standards for PHP 5.3 namespaces and class names. | |
* | |
* http://groups.google.com/group/php-standards/web/final-proposal | |
* | |
* // Example which loads classes for the Doctrine Common package in the | |
* // Doctrine\Common namespace. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.X = function(){ | |
var deferred = new $.Deferred(); | |
// DO AJAX | |
/* | |
$.ajax({ | |
// Do Ajax Call | |
url: '', | |
//Success |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* ========================= | |
* defaultTemplateByParentTv | |
* ========================= | |
* | |
* Plugin for modX Revolution | |
* Set default template for children of a ressource | |
* | |
* Author: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* DefaultValues v0.1 - Form input default values from labels | |
* by Marc Loehe | |
* http://marcloehe.de | |
*/ | |
(function ($) { | |
$.fn.DefaultValues = function() { | |
return this.each(function() { | |
var form = $(this); | |
$(this).find('input[type=text], textarea').each(function() { |
OlderNewer