Javascript Event Log ~ Console

April 15, 2009 at 5:18 pm | In Js/Ajax | 1 Comment
Tags: , , , , , , ,
  1. /*
  2. Below is the function where to call console()
  3. */
  4. window.document.onclick = function(){ console(window.event.target.onclick) };
  5. function console(msg)
  6. {
  7. mywin = window.open(”, ’console’, ’width=500,height=150,left=800,top=800,scrollbars=yes,location=no’);
  8. if (mywin && msg!=null)
  9. mywin.focus();
  10. mywin.document.title=’Javascript Console…’;
  11. //mywin.document.writeln(‘<h4>Javascript Log here..</h4>’);
  12. if(msg!=null)
  13. mywin.document.writeln(‘<div style=”font-family:Verdana, Arial, Helvetica, sans-serif; font-size:12px; border-bottom: 1px dotted #FFB64A; padding:4px;”>’+msg+’</div>’);
  14. //mywin.document.writeln(“<br /><a href=\”javascript:void(0)\” onclick=\”this.document.write=”;\” >Clear</a>”);
  15. //sleep(10); mywin.blur();
  16. }

auto hide popup with some delay

April 12, 2009 at 2:31 am | In Js/Ajax | Leave a Comment
Tags: , , , ,

write this code in parent window

function hideshow() {
sd=window.open(‘http://lalit241.wordpress.com’,'NewWin’,'toolbar=no,status=no,width=350,height=135′)
sd.moveTo(10,10);
}

</script>
</head>
<body onload=”hideshow()”>

Write this code in popup window

<script language=”javascript”>
var sec = 0;
function moveWin() {
sec++;
if (sec == 2) { window.blur(); }
if (sec == 3) { window.focus(); moveTo(10,350); }

window.setTimeout(“moveWin();”, 1000);
}

</script>
<body onLoad=”moveWin();” bgcolor=”#ffff00″>

Don’t Reload popup window When main window is reload

April 12, 2009 at 2:19 am | In Js/Ajax | Leave a Comment
Tags: , , , , , ,

function popupmat()
{

var mylink=’http://lalit241.wordpress.com’
var windowname=’lalit241′
var refocus=true;

var mywin, href;
if (typeof(mylink) == ’string’)

href=mylink;

else

href=mylink.href;

mywin = window.open(”, windowname, ‘width=400,height=200,scrollbars=yes’);
// if we just opened the window

if (

mywin.closed ||

(! mywin.document.URL) ||

(mywin.document.URL.indexOf(“about”) == 0)

)

mywin.location=href;

else if (refocus)

mywin.focus();

return false;
}

Blog at WordPress.com. | Theme: Pool by Borja Fernandez.
Entries and comments feeds.