Thursday, August 31, 2017

This was an answer to how to remove a script tag that was dynamically added. 😧


var flag1=0,flag2=0;

$(window).resize(function()
{
    if ($(window).width() < 480)
    {
        flag1++;
        console.log(flag1);
        flag2=0;  
    }
    else 
        if($(window).width() > 480)
        {
            flag2++;
            console.log(flag2);
            flag1=0;
        }

    if(flag1==1)
    {
        $("body").append("<script class='abc' src='custom.js'/>");
    }
    else
        if(flag2==1)
        {
            $(".abc").remove();
        }
});

Monday, July 31, 2017

Year we go!

She really couldn't think of another way to count down a year...?


echo '<option value="'.date('Y').'">'.date('Y').'</option>';
for ($i=1; $i<=100; $i++) {
   $year_wanted='-'.$i.' year';
   $year_inpast=date('Y',strtotime($year_wanted));
   echo '<option value="'.$year_inpast.'">'.$year_inpast.'</option>';
}

Wednesday, July 26, 2017

No problems here

if ( count($set2) >= 1 )
{
    $test = 0;
}
else
{
    $test = 0;
}

They really wanted an array

$data = array();
$data = array(
    'patient_id' => $id,
    'video_id' => $videoid,
    'created_date' => $date . ' ' . $time,
    'created_by' => 0,
    'sch_id' => $schid
);

if ( is_array($data) !== false )
{
...