Skip to content

Instantly share code, notes, and snippets.

lat1 = $(this).attr('lat');
lng1 = $(this).attr('lng');
latLng1 = new google.maps.LatLng(lat1, lng1, true);
$array = array(
'multi' => array(
'foo' => -5
)
);
<?php
function replace($string){
substr_replace($string, 'aaaa', 5, 8);
}
$str = 'abcdefghijklmnopqrstuvwxyz';
replace($str);
echo $str; // returns: abcdefghijklmnopqrstuvwxyz
?>
{
"location": "Santa Monica
"
}
<html>
<head>
<style>
#main{
border: 1px solid #000;
width:800px;
margin-left:auto;
margin-right:auto;
}
.long{
<!--
Description: This is just a testing file...
-->
<html>
<head>
<script src='jquery.js'></script>
<script>
$(document).ready(function(){
$('#input').click(function(){
console.log('a');
var dataString = 'name='+ name + '&spectator=' + spectator;
$.ajax({
type: "POST",
url: "/php/login.php",
data: dataString,
success: function() {
$('#login_form').html("");
$('#controls2').html("")
.fadeIn(1500, function() {
var refreshId = setInterval(function() {
<html>
<head>
<script src='jquery.js'></script>
<script>
$(document).ready(function(){
// When hovered
$('#leftTab').on('mouseenter', '.starImg', function(){
console.log('asdasd');
this.src = 'images/stardown.png';
$.ajax({
url: "somefile.php"
}).done(function(result){
firstArray = result.split('~');
var secondArray = [];
$.each(firstArray, function(index, value){
secondArray[index] = decodeURIComponent(value);
var secondArray2 = $.parseJSON(secondArray[index]);
console.log(secondArray2.user);
});
$('#search').click(function(){
$.ajax({
url: "search.php",
}).done(function(result){
$('#results').replaceWith('<div class="someclass">sometext</div>');
$('.ad').bind('click');
});
});
$('.someclass').on('click', function(){