Skip to content

Instantly share code, notes, and snippets.

@ksnider
Last active August 29, 2015 14:13
Show Gist options
  • Save ksnider/0d03192f0ed58910acbd to your computer and use it in GitHub Desktop.
Save ksnider/0d03192f0ed58910acbd to your computer and use it in GitHub Desktop.
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.2/themes/smoothness/jquery-ui.css" />
<script src="//code.jquery.com/jquery-1.10.2.js">
</script>
<script src="//code.jquery.com/ui/1.11.2/jquery-ui.js">
</script>
<script type="text/javascript">
$ = jQuery;
$(document).ready(function() {
var dateFields = [
'inf_custom_LastViewDate',
'inf_custom_FirstLoginDate'
];
$.each(dateFields, function (idx, val) {
if ( ! $('#' + val).length) {
return;
}
$('#' + val).datepicker();
});
});
</script>
<script type="text/javascript">
$ = jQuery;
$(document).ready(function() {
var query, param, arg;
var escape = function (content) {
var elements = {
'&': 'amp;', '<': 'lt;',
'>': 'gt;', '"': 'quot;',
"'": '#39;', '/': '#x2F;'
};
return String(content).replace(/[&<>"'\/]/g, function (c) { return '&' + elements[c]; });
};
$('html').css('display', 'none');
if (query = window.top.location.href.split('?')[1]) {
$.each(query.split('&'), function (idx, val) {
param = val.split('=')[0];
el = '[param="' + escape(param) + '"]';
arg = val.split('=')[1];
if ( ! $(el).length) {
return;
}
$(el).html(escape(arg));
});
}
$('html').css('display', '');
});
</script>
// Hi <span param="inf_field_FirstName" style=""></span>, please submit your resume.
// Assuming inf_field_FirstName was passed in query string, this will display in html on form or page
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment