Development Blog by Professionals
Posts tagged JavaScript
display an object inf javascript
Apr 6th
Here’s how to show the contents of a object in Javascript
function concatObject(obj) {
str='';
for(prop in obj)
{
str+=prop + " value :"+ obj[prop]+"\n";
}
return(str);
}
More >
Print DIV
Aug 26th
<script>
function go()
{
var a = window.open(”,”,’width=300,height=300′);
a.document.open(“text/html”);
a.document.write(document.getElementById(‘foo’).innerHTML);
a.document.close();
a.print();
}
</script>
<div id=”foo”>This is a test</div>
<input type=”button” onclick=”go()” value=”Print this Page”>
Open / Close Pop Up window
Jul 16th
The HEAD of the Page put the follow script
<script type=”text/javascript”>
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
</script>
Open window Script
<a href="#" onmousedown="MM_openBrWindow('page_path.php','gallery','scrollbars=yes,resizable=yes,width=600,height=500')" >Open Window</a>
Close window Script (inside page_path.php )
<a href="#" onclick="javascript:self.close(); ">Close Window</a>
Close window popup and reload parent Page (inside page_path.php )
<a href="#" onclick="window.opener.window.location.reload(true);window.self.close()">Close Window</a>


