Disable f5 and browser refresh using javascript | Inside Window or Iframe
Javascript code:
function disableF5(e) { if ((e.which || e.keyCode) == 116) e.preventDefault(); };
$(document).on("keydown", disableF5);
Web Development Codes, Yii tutorials, PHP codings, Yii widgets, Jquery. PHP css javascript, yii framework, Php frameworks, Web development guide to freshers and experienced coders.
http://localhost/firstapp/index.php
If everything is Ok, it will be like this.
Source: yiiframework.com
You can change the contents of this home page at
protected/views/site/index.php .in the same way you can edit about us page at
protected/views/site/pages/about.phpcontact us page at
protected/views/site/contact.phplog in page at
protected/views/site/login.phpand finally error page at
protected/views/site/error.php
% cd WebRoot % php YiiRoot/framework/yiic.php webapp firstapp
in Your view file
$this->beginWidget('application.extensions.sidebar.Sidebar', array('title' => 'Menu', 'collapsed' => true, 'position'=>'left')); //here you display a cmenu or gridview or any other thing as per your needs. //or you can simply display contents form variable like below echo $var; $this->endWidget();
echo '<div class="title">' ;
echo CHtml::encode($this->title);
echo CHtml::ajaxLink('>>', '', false, array('id' =>
'toggle_left_menu'));
echo '</div>';
Step 2: Change This,
echo '<div class="title">' ;
echo CHtml::encode($this->title);
echo '</div>';
To,
echo '<div class="title">' ;
echo CHtml::encode($this->title);
echo CHtml::ajaxLink('>>', '', false, array('id' =>
'toggle_right_menu'));
echo '</div>';
and in js folder,
$("*") It selects all elements $(this) It selects current element $("p.intro") It selects <p> element with 'intro' as classname $("p:first") It selects first <p> element in the entire DOM $("ul li:first") It selects first <li> element in first <ul> $("ul li:first-child") It selects first <li> element in all <ul> $("[href]") It selects all element with href as attribute $("a[target='_blank']") it selects all links with target value as blank $("a[target!='_blank']") it selects all links with target not as blank |