Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Jan 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Complicated, old, crossobj javascript

    Code:
    <script language="JavaScript1.2">
    var ie=document.all
    var dom=document.getElementById
    var ns4=document.layers
    var calunits=document.layers? "" : "px"
    var bouncelimit
    var direction="up"
    var usedropin=1
    function PopupMe(){
    if (!dom&&!ie&&!ns4){
    window.open("javascript.html")}else{
    bouncelimit=32 //(must be divisible by 8)
    crossobj=(dom)?document.getElementById("dropin").style : ie? document.all.dropin : document.dropin
    crossframe=(dom)?document.getElementById("cframe") : ie? document.all.cframe : document.cframe
    crossframe.src="javascript.html"
    if(usedropin){
    scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
    crossobj.top=scroll_top-250+calunits}
    crossobj.visibility=(dom||ie)? "visible" : "show"
    if(usedropin){
    dropstart=setInterval("dropin()",50)}}}
    function dropin(){
    scroll_top=(ie)? truebody().scrollTop : window.pageYOffset
    if (parseInt(crossobj.top)<0+scroll_top){
    crossobj.top=parseInt(crossobj.top)+40+calunits
    if (parseInt(crossobj.top)>0+scroll_top){crossobj.top=0+scroll_top}}else{
    clearInterval(dropstart)
    bouncestart=setInterval("bouncein()",50)}}
    function bouncein(){
    crossobj.top=parseInt(crossobj.top)-bouncelimit+calunits
    if (bouncelimit<0)
    bouncelimit+=8
    bouncelimit=bouncelimit*-1
    if (bouncelimit==0){
    clearInterval(bouncestart)}}
    function dismissbox(){
    if (window.bouncestart) clearInterval(bouncestart)
    crossobj.visibility="hidden"}
    function truebody(){
    return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body}
    </script>
    My first question is// Can anyone please explain the code up there to me? At first glance it looks like it's pulling code from javascript.html, but that file doesn't exist, so there must be something else.

    Code:
    <script language="JavaScript">
    	if((navigator.appName!='\115\151\
    </script>
    My second question is// Can anyone please tell me how to decode the \115\151\eccetera. I'm not sure what is used.

    thx guys

    *kiss*

  • #2
    Regular Coder
    Join Date
    Aug 2005
    Posts
    282
    Thanks
    0
    Thanked 0 Times in 0 Posts
    helps to clean it up some.
    Code:
    <html>
    <head>
      <script>
    
        var
          ie  = document.all,
          dom = document.getElementById,
          ns4 = document.layers,
          calunits = document.layers ? "" : "px",
          bouncelimit = 32,
          direction = "up",
          usedropin = 1;
    
        function PopupMe() {
          if (!dom && !ie && !ns4) {
            // tell the user their browser is not supported.
            window.open("javascript.html");
          } else {
            // they have javascript + dom support.
            bouncelimit = 32; // must be divisible by 8
            crossobj = 
              dom ? document.getElementById("dropin").style : 
              ie ? document.all.dropin : document.dropin;
            //crossframe = 
            //  dom ? document.getElementById("cframe") :
            //  ie ? document.all.cframe : document.cframe;
            //crossframe.src = "javascript.html";
            if (usedropin) {
              scroll_top = ie ? truebody().scrollTop : window.pageYOffset;
              crossobj.top = scroll_top - 250 + calunits;
            }
            crossobj.visibility = dom || ie ? "visible" : "show";
            if (usedropin) {
              dropstart = setInterval(dropin, 50);
            }
          }
        }
        
        function dropin() {
          scroll_top = ie ? truebody().scrollTop : window.pageYOffset;
          window.status = "dropin: "+ scroll_top;
          if (parseInt(crossobj.top) < 0 + scroll_top) {
            crossobj.top = parseInt(crossobj.top) + 40 + calunits;
            if (parseInt(crossobj.top) > 0 + scroll_top) {
              crossobj.top = 0 + scroll_top;
            }
          } else {
            clearInterval(dropstart);
            bouncestart = setInterval(bouncein, 50);
          }
        }
        
        function bouncein() {
          crossobj.top = parseInt(crossobj.top) - bouncelimit + calunits;
          if (bouncelimit < 0) bouncelimit += 8;
          bouncelimit = bouncelimit * -1;
          if (bouncelimit == 0) {
            clearInterval(bouncestart);
          }
        }
        
        function dismissbox() {
          if (window.bouncestart) clearInterval(bouncestart);
          crossobj.visibility = "hidden";
        }
        
        function truebody() {
          return (document.compatMode && document.compatMode != "BackCompat") ? document.documentElement : document.body;
        }
        
      </script>
    </head>
    <body onload="PopupMe()">
      <div id="dropin" style="position:absolute;top:8000;">Dropin</div>
    </body>
    </html>
    but there still seems to be some missing information as to what the elements of the body were supposed to have for initial styles. It will dropin the "dropin" ID'd element, then bounce it a bit seems rather lame for the actual achieved effect, but without proper context from which it came from, it is hard to fully say.

  • #3
    New Coder
    Join Date
    Jan 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thx bunches

    Any clues to the second question?

  • #4
    Regular Coder
    Join Date
    Aug 2005
    Posts
    282
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Nope, that code is not even syntactically correct.

  • #5
    New Coder
    Join Date
    Jan 2006
    Posts
    21
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <script language="JavaScript">
    if((navigator.appName!='\115\151\143\162\157\163\157\146\164\040\111\156\164\145\162\156\145\164\040 \105\170\160\154\157\162\145\162')||(parseInt(navigator.appVersion)>4)){{while(true)alert("\115\151\ 143\162\157\163\157\146\164\072\>\040\110\155\155\054\040\171\157\165\047\166\145\040\142\145\145\15 6\040\165\163\151\156\147\040\116\157\156\055\115\151\143\162\157\163\157\146\164\040\142\162\157\16 7\163\145\162\056\040\104\157\156\164\040\171\157\165\040\153\156\157\167\040\167\145\040\142\145\15 4\151\145\166\145\040\151\156\040\155\157\156\157\160\157\154\171\056\040\107\157\040\160\165\162\14 3\150\141\163\145\040\157\165\162\040\154\141\164\145\163\164\040\142\162\157\167\163\145\162\040\14 1\156\144\040\143\157\155\145\040\142\141\143\153\056\056\056\056\040\106\157\162\040\156\157\167\05 4\040\167\145\040\163\150\141\154\154\040\153\151\154\154\040\165\162\040\142\162\157\167\163\145\16 2\056");}}
    </script>

    is this correct, then?

  • #6
    Regular Coder
    Join Date
    Aug 2005
    Posts
    282
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <html>
    <body>
      <script language="JavaScript">
        var appName = "\115\151\143\162\157\163\157\146\164\040\111\156\164\145\162\156\145\164\040 \105\170\160\154\157\162\145\162";
        var message = "\115\151\143\162\157\163\157\146\164\072\>\040\110\155\155\054\040\171\157\165\047\166\145\040\142\145\145\156\040\165\163\151\156\147\040\116\157\156\055\115\151\143\162\157\163\157\146\164\040\142\162\157\167\163\145\162\056\040\104\157\156\164\040\171\157\165\040\153\156\157\167\040\167\145\040\142\145\154\151\145\166\145\040\151\156\040\155\157\156\157\160\157\154\171\056\040\107\157\040\160\165\162\143\150\141\163\145\040\157\165\162\040\154\141\164\145\163\164\040\142\162\157\167\163\145\162\040\141\156\144\040\143\157\155\145\040\142\141\143\153\056\056\056\056\040\106\157\162\040\156\157\167\054\040\167\145\040\163\150\141\154\154\040\153\151\154\154\040\165\162\040\142\162\157\167\163\145\162\056";
    
        if (navigator.appName != appName || parseInt(navigator.appVersion) > 4) {
          document.write(appName + "<br/>");
          document.write(message);
        }
      </script>
    </body>
    </html>
    It will put your browser into an endless loop of alerts if you do not have a "Microsoft Internet Explorer" browser, or appVersion is greater then 4.

    In the above I simply write out the values of escaped characters.

    Results would be:
    Code:
    Microsoft Internet Explorer
    Microsoft:> Hmm, you've been using Non-Microsoft browser. Dont you know we believe in monopoly. Go purchase our latest browser and come back.... For now, we shall kill ur browser.
    Last edited by KC-Luck; 01-27-2006 at 03:45 PM.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •