javascript pop-up window close event

Add the below javascript to the javascript pop-up window on the close event of which you want to execute a particular javascript funciton.

window.onbeforeunload = 
 function(){
      // add the javascript code here which you want to execute at the close of this pop-up window
 }

modalbox javascript onclose event

Today after along period writing a post. I tried a new javascript library called modalbox js. Was working very good, but i had to run other javascript when the box was closed. Found some help at http://code.google.com/p/modalbox/wiki/MethodsReference but didn’t found the exact syntax.

After some trial and error finally succeeded, so thought to post on to the blog. Here is the syntax for javascript as well as for symfony (in case you are working with symfony)

Syntax for symfony:

<?php echo m_link_to(‘link_name’,
‘url’,
array(‘title’ => ‘title’),
array(‘width’ => 630, ‘height’ => 180, ‘afterHide’ => ‘afterhidealert‘)); ?>

here afterhidealert is the javascript function that will be called on the closing of the modalbox popup.

Syntax for javascript:

<a href=”url” onclick=”Modalbox.show(this.href, {afterHide:afterhidealert, height:180, title:this.title, width:630}); return false;” title=”title”>link_name</a>

here afterhidealert is the javascript function that will be called on the closing of the modalbox popup.

Thanks,

samsami2u

http://www.avidindiainc.com

Error levels and their values in php

Value Constant Description
2 E_WARNING Non-fatal run-time errors. Execution of the script is not
halted
8 E_NOTICE Run-time notices. The script found something that might be
an error, but could also happen when running a script normally
256 E_USER_ERROR Fatal user-generated error. This is like an E_ERROR set by
the programmer using the PHP function trigger_error()
512 E_USER_WARNING Non-fatal user-generated warning. This is like an E_WARNING
set by the programmer using the PHP function trigger_error()
1024 E_USER_NOTICE User-generated notice. This is like an E_NOTICE set by the
programmer using the PHP function trigger_error()
4096 E_RECOVERABLE_ERROR Catchable fatal error. This is like an E_ERROR but can be
caught by a user defined handle (see also set_error_handler())
8191 E_ALL All errors and warnings, except level E_STRICT (E_STRICT
will be part of E_ALL as of PHP 6.0)

ie 6 png fix – ie 6 png issue solutlion with css and/or js

The issue is with png type of images that are not properly displayed in ie 6 (internet explorer – Version 6). I found the solution somewhere on internet while googling.

Okay, so the solution goes as below:

1) download the files needed for the solution from http://demo.avidindiainc.com/ie6pngfix/ie6PNGFixDownload.zip

2) There are 5 files in the directory after you unzip it. They are  blank.gif, iepngfix.htc, iepngfix_tilebg.js, iepngfix.php and .htaccess.

3) for solving the issue the two files blank.gif and iepngfix.htc are enough. i will explain them first and we’ll go for the rest files later.

4) Copy and paste iepngfix.htc and blank.gif into your website folder.

5) Copy and paste this into your website’s CSS or HTML:

<style type=”text/css”>
img, div { behavior: url(iepngfix.htc) }
</style>

6) now the other  files work as follow. If you want support for CSS1 background-repeat and background-position, make sure you include the add-on .JS file in your <head>:

<script type=”text/javascript” src=”iepngfix_tilebg.js”></script>

7) Suppose if it works offline but not online, in this case you may have a MIME type problem. You must ensure your server is sending the correct MIME type of “text/x-component” for .HTC files. Try one of these two easy fixes:

  • Upload the “.htaccess” file from within this script’s download ZIP to your webserver, which will make Apache send the correct MIME type.
  • Instead of calling “IEPNGFIX.HTC” from your CSS, upload IEPNGFIX.PHP to the same folder and call that instead, which also sends the right MIME type.

Thats all folks. I hope this solves your issue with ie6.

flowplayer with auto playlist and seperate caption file for each clip along with external control bar

Flowplayer is free to download and available at flowplayer.org

it also have all these examples i.e.

1) Auto Playlist, 2)Playlist with captions on clips and 3)HTML Control bar

but here i have integrated all of the above three in one file/ one player

you can find the demo at http://demo.avidindiainc.com/flowplayer/

and you can download the files at http://demo.avidindiainc.com/flowplayer/flowplayer-download.zip

Thanks,

samsami2u

http://www.avidindiainc.com