browsers_dhtml

If you are using https pages or some of the pages (payment pages etc) in your website, keep the following in your mind. In some browsers especially IE shows warning of non-secured content in secured page. This cause user the feeling that the website is not secured.

  1. Use relative url always. Relative URL means those without starting with http:// or https://, instead use relative url.
  2. If you need to use full url, use dynamic base name in with your programming language.For example in PHP, define BASE_URL = http://www.yoursite.com and use this variable in every links and forms. Change the BASE_URL value between http and https depending upon the protocol ($_SERVER['HTTP_HOST'])
  3. Check  inside javascript function whether it is calling any non-secured url. (For example, sometime you may use full url inside Javascript). Check using if condition to decide, which protocol to use, like what Google Analytic does.
    eg:  (“https:” == document.location.protocol) ? “https://ssl.” : “http://www.”);
  4. Check if there is any flash content which tries to load data from non-secured url. There is a chance to load some xml configuration files using http protocol
  5. Also change the codebase parameter value in object tag (flash or other media) whether it is pointing http or https url. There is a chance for this url in flash content.
    codebase=”http://download.macromedia.com/pub/shockwave /cabs/flash/swflash.cab#version=9,0,115,0″
    Change this url to https://downoad…

  6. If you are using facebook connect or such integration, check the javascript initialisation code.
    FB.init(“78bc8ffb87c41eabb6395a2045c76021″, “/xd_receiver.htm“);
    Inside the xd_receiver.htm file, the cross platform callback will be non secured url (http)
    Change this to xd_reciver_ssl.htm and use new code, which is available in Facebook documentation

Tools like Fiddler can be used to check which url is non-secured. Firebug cannot show all non-secure connections. If the above steps do not solve your problem, try disabling javascript files one by one to point out which call is making the problem. Also try this by disabling Flash objects one by one.

Good luck guys

Cheers

Sajith

Tags: , , , , , , , , , , ,

· · · ◊ ◊ ◊ · · ·

JBar – Jquery Bar

27 Dec 2009

Flash messages or notification messages are very essential part of every update/edit or delete operations. We either use ajax update messages like “You account has been updated” or “Your photo has been successfully deleted”

Here, a new plugin of jQuery can be used to display the flash messages like twitter. (see twitter’s settings page)

I added some more functions to this plugin to display the notification in different context, say information, warning or error message. The function show_flash(‘message here’); can be used for this purpose. Second parameter is the type of message. For example, show_flash(‘Error in deleting file’, ‘error’) OR  show_flash(‘Email address entered is invalid’, ‘warning’)

If you use sessions to save flash message , for example in codeigniter $this->session->set_flashdata(‘message’,'hello’); you can use this plugin to display them by adding a php code in the footer  (or header) of every page

<?php if($this->session->flashdata(‘message’) != ” )  : ?>

<script>show_flash(‘<?= $this->session->flashdata(‘message’) ?>’)</script>

<?php endif; ?>

Here you can download the full source code:  http://www.sajithmr.me/downloads/jbar.zip

Screen shot 2009-12-27 at 11.30.12

Thanks

Sajith

Tags: , , , , , , , , , , , , ,

· · · ◊ ◊ ◊ · · ·

Firephp

18 Aug 2009

We like firebug , We like PHP , if so, We also begin to  like FirePHP !!!

Using firephp , you can debug your php code. Firephp is a firefox plugin which works on firebug console.

In our php life, we know we can use echo function to print or debug the value of a variable and we usually do that. But if there is any header function such as image manipulation, redirection etc, if you use echo or print either it leads into unwanted results or we get the common error, cannot modify header information headers already sent  !!!

The one solution for this is, writing the variable value into a log file and check the log file after execution. But the advantage of fire php is, you can log messages, or value of a variable and can see through firebug console.

For example:

<?php $fire_php->log(‘Enter into function’); ?>

<?php $fire_php->log($result); ?>

You can also categorize your error as warning or error . eg:

<?php $fire_php->warn(‘Variable value is not set’)?> or

<?php $fire_php->error(‘No parameter passed’) ?>

For more go to: http://www.firephp.org/

Tags: , , , , , , , ,

· · · ◊ ◊ ◊ · · ·

Today i published my new wordpress plugin, which control user navigation. The plugin name is “Close Warning”.

It prompts the user a confirmation message before they close the browser window or tab. After that a lightweight window popup jumps up with your preset announcement or message  (in richtext format)

The Advantages >>

  1. You can avoid the accidental close of browser window
  2. You can tell or mention any message or offers before they navigate away from your website
  3. It works not only on closing, but in any type of external navigation (Internal navigation is screened out from this warning)
  4. Since it is built on lightweight window support, your message or warning appears very eye-catchy

You can download the plugin from : http://www.sajithmr.com/downloads/onclose-warning.zip

Screen Shot - Warning before close

Screen Shot - Warning before close

From the setting page, you can set your rich text message or warning / offer . See the screen shot:

Warning Before Closing

Warning Before Closing

Please feel free to mail me regarding any clarification and upgrade to admin@sajithmr.com

Regards

Sajith

Tags: , , , , , ,

· · · ◊ ◊ ◊ · · ·

In some cases, if you are in between any work of editing or typing a content, and you wont let the visitor to navigate away from the page without particular condition, say the document is not saved yet, you can block the navigation (even the closing of the browser window) with Javascript.

Here is the javascript code for that:


<script>

window.onbeforeunload = function (evt) {
var message = ‘Are you sure you want to leave?’;
if (typeof evt == ‘undefined’) {
evt = window.event;
}
if (evt) {
evt.returnValue = message;
}
return message;
}

</script>

Just paste this code anywhere in your html page. The condition settings , warning messages are up to you. In the above code, the warning will be displayed when ever a navigation happen (Even closing of browser window happen)

(pic from Binney V.A)

Tags: , , , , , , , ,

· · · ◊ ◊ ◊ · · ·

وظائف 2011 تحويل العملات برامج برنامج تسريع التحميل برنامج الفلاش برنامج محول الصوتيات عربي hotel 2011 زيادة رواتب العساكر 1431