java Script

how to print contents of specific div at html?

function printdiv(id) { try{ var x = ”; x = document.getElementById(id).innerHTML; //alert(x); newwindow2=window.open(”,’name’,’scrollbars=yes,resizable=yes,height=500,width=500,toolbar=1′); newwindow2.title = “The new title goes here.”; var tmp = newwindow2.document; tmp.write(x); newwindow2.print(); tmp.close(); newwindow2.close(); }catch(err){} }

Jquery

childs with Jquery (select,ul)

jQuery(document).ready(function() { jQuery(‘#active_booking_formid :nth-child(2)’).attr(‘selected’, ‘selected’); jQuery(‘#active_booking_formid’).trigger(‘change’); jQuery(‘ul.art-menu>li:nth-child(1) a’).addClass(‘menuItem2’); jQuery(‘ul.art-menu>li:nth-child(1) a span.t’).addClass(‘specialforhome’); /*jQuery(‘ul.art-menu>li:nth-child(3) a’).addClass(‘menuItem2’); // services jQuery(‘ul.art-menu>li:nth-child(5) a’).addClass(‘menuItem2’); //contact us */ });

Jquery

javascript method for ajax

function getVersionInfo(contentID,version) { $(‘input[name=published]’).removeAttr(‘checked’); //reset publish //alert(version); $.ajax({ url: “/CSAB/Content/selectedversioninfo/”+version+”/”+contentID+””, dataType:”xml”, success: function(xml){ //alert(xml); var phisicalName=find(xml, “phisical-name”); var selectedVersion=find(xml, “selected-version”); var publishedVer=find(xml, “published-ver”); var contents=find(xml, “contents”); $(“#phisicalNameid”).val(phisicalName); $(“#contentsid”).val(contents); } }); } function find(xml, name) { var nodes = xml.documentElement.childNodes; for (i = 0; i < nodes.length; i++) { var node = nodes[i]; if (node.nodeName.toLowerCase() ==… Continue reading javascript method for ajax