Welcome To Snipplr
Everyone's Recent Snippets Tagged js
- All /
- JavaScript /
- HTML /
- PHP /
- CSS /
- Ruby /
- Objective C
Simple ajax object for creating ajax calls.
Why use SimpleAjax?
- Very small, only 2kb minified
- Make a asynchrone or synchrone ajax call ( AJAX / SJAX )
- Use quick methods get() and post() for GET and POST calls
- Use load() method for...
0
705
posted 13 years ago by freelancephp
I wanted to pass a form submission (array) as a JSON object to another function.
Some form field were created with JS, to identify them their names have been concatenated with unique IDs, etc.
In order to access values of that JSON obj I needed to...
1
808
posted 13 years ago by iroybot
I wanted to pass a form submission (array) as a JSON object to another function.
Some form field were created with JS, to identify them their names have been concatenated with unique IDs, etc.
In order to access values of that JSON obj I needed to...
0
938
posted 13 years ago by iroybot
JavaScript
JS - onclick function to insert text characters symbol into text input field or textarea at the cursor caret location position
// big thanks to these tips for giving me code to steal: http://bit.ly/bundles/brandonjp/9
/*
* USAGE: give your HTML textarea or text input element an ID
* give your button an onClick="insertThisInThere(text2insert, theInputIDwhereItGoes);"...
0
2151
posted 13 years ago by brandonjp
Data Types for DB, MySQL, SQLite, PHP, Ruby, Rails, JS, etc. because I forget them sometimes
from Ruby on Rails Guides: Migrations http://bit.ly/hFWjT0
from Rails Migrations http://bit.ly/hI5zpz
0
997
posted 13 years ago by brandonjp
Giorgio fecit.
Serve per controllare, a partire da un checkbox, che non ne siano selezionati altri nella stessa riga.
0
725
posted 14 years ago by tuffo19
it parses given string and returns 1st number it encounters ( it will replace comas with dots so floats formatted as 12,345 could be 12.345 ( some countries use that ) )
then u can parse returned value as a number / float / int - do what You need...
0
885
posted 14 years ago by stryju
When injecting via jQuery HTML content which contains script tags referencing external scripts, which are then referenced via scripting elsewhere in the injected HTML, some browsers (Chrome) will not wait for the external scripts to load causing the...
2
1094
posted 14 years ago by harikaram
Be sure to call the exact version desired or the script is only cached for one hour!
http://encosia.com/2009/10/11/do-you-know-about-this-undocumented-google-cdn-feature/
1
879
posted 14 years ago by housecor
pass in 2 json objects returns an array of all differences included those nested in children.
_Q used internally to pass through to self, do not pass in _Q
0
976
posted 14 years ago by tennison
Alternative for "return false;"
stopPropagation(); prevents for bubbling up the dom
preventDefault(); prevents the browser from performing the default action
1
871
posted 14 years ago by dkl3in
A more flexible version of the 'official' Facebook feed dialog example.
"The Feed Dialog prompts the user to publish an individual story to a profile's feed. This does not require any extended permissions."
"The following simple JavaScript exam...
0
879
posted 14 years ago by coprolit
Display a default value in a text field that disappears on focus and reappears on blur **if** the field is blank.
0
552
posted 14 years ago by prsjohnny