function(data) {
var myWindow = window.open('','Name of the Window','');
myWindow.document.open();
myWindow.document.write(data);
myWindow.document.close();
}
Note: You need to make sure your browser pop up blocker has disabled.
function(data) {
var myWindow = window.open('','Name of the Window','');
myWindow.document.open();
myWindow.document.write(data);
myWindow.document.close();
}
$(document).ready(function() {
$('#alert_messages').animate({opacity: 1.0}, 5000).fadeOut();
});
$("#selectAllButt").click(function() { $("#mySelectList option").each(function() { $(this).attr("selected","selected"); }); });
$("#selectNoneButt").click(function() { $("#mySelectList option").each(function() { $(this).removeAttr("selected"); }); });
$("#chkBoxIdOrRadioButtId").is(":checked");- returns a boolean true if checked or false
$("#chkBoxIdOrRadioButtId").not(":checked");- returns a boolean true if unchecked or false
$("#chkBoxIdOrRadioButtId").attr('checked','checked');- programmatically check the desired.
$("input:radio[name='myRadioGrpName']:checked").val();- return the value of the checked radio from the 'myRadioGrpName' group.
$("input[name='myChkBoxGrp']:checked").length;- returns the count of the checked
$("input[name='myChkBoxGrp']:not(:checked)").length;- returns the count of the unchecked
$('#mySelectBoxId option').length;
$('#mySelectBoxId option:selected').length;
if(!Array.indexOf) {
Array.prototype.indexOf = function(obj) {
for(var i = 0; i < this.length; i++) {
if(this[i] == obj) { return i; }
}
return -1;
}
}
function foo() {
if(some condition) {
alert("Status update");
}
}
USE :
function foo() {
if(some condition) {
console.log("Status update");
}
}
var date = new Date();
var sysDate = date.getDate();
var sysMonth = date.getMonth();
var sysYear = date.getFullYear();
document.write(sysMonth + "/" + sysDate + "/" + sysYear);
var date = new Date();
var sysDate = date.getDate();
var sysMonth = date.getMonth();
var sysYear = date.getFullYear();
var monthNames = new Array("January", "February", "March",
"April", "May", "June", "July", "August",
"September", "October", "November",
"December");
document.write(sysDate + "-" + monthNames[sysMonth] + "-" + sysYear);
var date = new Date();
var sysDate = date.getDate();
var sysMonth = date.getMonth();
var sysYear = date.getFullYear();
var monthNames = new Array("January", "February", "March",
"April", "May", "June", "July", "August",
"September", "October", "November",
"December");
var sup = "";
if(sysDate == 1 || sysDate == 21 || sysDate == 31) sup ="st";
else if (sysDate == 2 || sysDate == 22) sup = "nd";
else if (sysDate == 3 || sysDate == 23) sup = "rd";
else sup = "th";
document.write(sysDate + "" + sup + " " + monthNames[sysMonth] + " " + sysYear);
<script src="jquery.js"> </script>
<script src="prototype.js"> </script>
<script type="text/javascript" >
jQuery.noConflict() //now by default, $ is jQuery.
//But you can reassign it to your own variable.
var $jq = jQuery;
//start using $jq for jquery's $
$jq(document).ready(function() {
$jq("div").hide(); });
</script>
If you've ever found yourself needing to measure the execution time of specific portions of your Python code, the `contextlib` module o...