how to convert javascript into html
2014-11-06, 06:55 AM,
#1
i want to put linkbucks code in my website but my website does not support javascript code i want to convert my linkbucks javascript code into html how i can do this

if anybody can do this then please convert my javascript code into html my javescript code is below

<script type="text/javascript" src="http://www.theseforums.com/Webservices/jsParseLinks.aspx?id=AcXdk"></script>

i will do appreciate your help
Reply
2014-11-06, 07:36 AM,
#2
Converting this code bellow into javascript is impossible. Or at least very very hard. You gotta search why your website don't support javascript, normally it should support it...

Code:
(function(){
    

    var Linkbucks = {
        
        LinkId: "AcXdk",
        LinkType: 2,
        LinkTarget: 2,
        Exclusions: "",
        Frequency: 0,
        EncryptUrl: true,
        Domain: "theseforums.com",
        LinkUrl: "http://www.theseforums.com/AcXdk",
        Outside: this,

        Init: function() {

            // Backwards compatibility
            if (this.LinkId == 0) {
                
                if (typeof this.Outside.lb_params != "undefined" && this.Outside.lb_params[0] != null)
                    this.LinkId = this.Outside.lb_params[0];
                else if (typeof this.Outside.uid != "undefined")
                    this.LinkId = this.Outside.uid;
                
                if (this.LinkId != 0)
                    this.AddScript("http://www." + this.Domain + "/WebServices/jsParseLinks.aspx?id=" + this.LinkId);
                    
                return;
            }
            
            // Link does not exist
            if (this.LinkType == 0)
                return;

            // Attach to the click event on the document. This allows to support links created dynamically after script was run
            Linkbucks.AddEvent(document, "mousedown", function(e){
                var anchor = Linkbucks.GetAnchorElement(e);              
                if (anchor != null && !Linkbucks.IsExcluded(anchor)) {
                    if (Linkbucks.LinkType == 3){
                        if (!anchor.boundPop){
                            Linkbucks.AddEvent(anchor, "click", Linkbucks.HandlePop);
                            anchor.boundPop = true;    
                        }
                    } else if (Linkbucks.Frequency == 0 || Linkbucks.Increment() <= Linkbucks.Frequency) {
                        Linkbucks.HandleClick(anchor);
                    }
                }
            });
        },

        HandlePop: function(){
            if (Linkbucks.Frequency != 0 && Linkbucks.GetDisplays() >= Linkbucks.Frequency){
                return;
            }
            
            Linkbucks.Increment();
            var pop = new popUnder(Linkbucks.LinkUrl + '?r=' + encodeURIComponent(document.location.href), {
                        name: 'ad_' + Math.floor(89999999 * Math.random() + 10000000),
                        width: window.screen.availWidth,
                        height: window.screen.availHeight,
                        top: 0,
                        left: 0
                });
            pop.open();
            return;
        },
        
        HandleClick: function(e) {
            if (this.LinkTarget == 1)
                e.target = "_top";
            else if (this.LinkTarget == 2)
                e.target = "_blank";
                
            var linkUrl = this.LinkUrl + "/url/";

            if (this.LinkType == 4 || (this.LinkType == 2 && this.EncryptUrl))
                e.href = linkUrl + this.ConvertToHex(this.Encode(e.href), "");
            else
                e.href = linkUrl + e.href;
        },
        
        IsExcluded: function(e) {
                    
            var exclusionList = this.FormatExclusionsArray(this.Exclusions);
            exclusionList.push(this.LinkId, this.ConvertToUnicode(this.LinkId), this.ConvertToHex(this.LinkId, "%"));
            
            if (!this.StartsWith(e.href, new Array("http://", "https://")))
                return true;
                
            if (exclusionList[0].length > 0 && this.MatchesWith(e.href, exclusionList))
                return true;
                
            return false;
            
        },
                
        AddEvent: function(target,eventName,handlerName) {

            if ( target.addEventListener ) {
                target.addEventListener(eventName, eval(handlerName), false);
            } else if ( target.attachEvent ) {
                target.attachEvent("on" + eventName, eval(handlerName));
            } else {
                var originalHandler = target["on" + eventName];
                if ( originalHandler ) {
                      target["on" + eventName] = eval(handlerName);
                } else {
                      target["on" + eventName] = eval(handlerName);
                }
            }
        },
        
        AddScript: function(scriptUrl) {
            
            var s1 = document.createElement("script");
            
            s1.type = "text/javascript";
            s1.async = true;
            s1.src = scriptUrl;
            
            var s2 = document.getElementsByTagName("script")[0];
            s2.parentNode.insertBefore(s1, s2);
        },
        
        FormatExclusionsArray: function(items) {
            
            var exclusionList = items.split(",");
            var wildCardIndex = 0;
            
            for (i = 0; i < exclusionList.length; i++)
            {
                wildCardIndex = exclusionList[i].indexOf("*");
        
                if (wildCardIndex > -1) {
                    exclusionList[i] = exclusionList[i].substring(wildCardIndex+1);
                }
                
                exclusionList[i] = this.LTrim(this.RTrim(exclusionList[i]));
            }
            
            return exclusionList;
        },
        
        GetAnchorElement: function(e) {
        
            if (!e)
                e = window.event;
        
            var srcElement = e.srcElement ? e.srcElement : e.target;

            do
            {
                if (srcElement.tagName == "A")
                    return srcElement;
                
                if (srcElement.parentNode)
                    srcElement = srcElement.parentNode;
            }
            while (srcElement.parentNode)
        
            return null;
        },

        GetDisplays: function(){
            var cookie = "lbfrequency";
            var total = this.ReadCookie(cookie);
            return (total != null) ? total : 0;
        },
                
        Increment: function() {
            
            var cookie = "lbfrequency";
            var total = this.ReadCookie(cookie);

            total = (total != null) ? parseInt(++total) : 1;

            this.CreateCookie(cookie, total, 1);
            
            return total;
        },
        
        CreateCookie: function(name, value, days) {
        
            if (days) {
                var date = new Date();
                date.setTime(date.getTime()+(days*24*60*60*1000));
                var expires = "; expires="+date.toGMTString();
            }
            else var expires = "";
                document.cookie = name+"="+value+expires+"; path=/";
        },
        
        ReadCookie: function(name) {
        
            var ca = document.cookie.split(';');
            var nameEQ = name + "=";
            for(var i=0; i < ca.length; i++) {
                var c = ca[i];
                while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
                    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
                }
            return null;
        },
        
        ConvertToUnicode: function(value) {
            
            result = '';
            for (i = 0; i < value.length; i++) {
                result += '&#' + value.charCodeAt(i);
            }
            return result;
        },
        
        ConvertToHex: function(value, prepend) {
            
            var hex = '';
            for (i = 0; i < value.length; i++) {
                if (value.charCodeAt(i).toString(16).toUpperCase().length < 2) {
                    hex += prepend + "0" + value.charCodeAt(i).toString(16);
                } else {
                    hex += prepend + value.charCodeAt(i).toString(16);
                }
            }
            return hex;
        },
        
        StartsWith: function(str, e) {
            
            if (typeof e == "object")
            {
                for (_i = 0; _i < e.length; _i++)
                {
                    if (str.toLowerCase().indexOf(e[_i].toLowerCase()) == 0)
                        return true;
                }
                return false;
            }
            else
                return (str.toLowerCase().indexOf(e.toLowerCase()) == 0);
        },
        
        MatchesWith: function(str, e) {
            
            if (typeof e == "object")
            {
                for (_i = 0; _i < e.length; _i++)
                {
                    if (str.toLowerCase().indexOf(e[_i].toLowerCase()) > -1)
                        return true;
                }
                return false;
            }
            else
                return (str.toLowerCase().indexOf(e.toLowerCase()) > -1);
        },
        
        LTrim: function(str) {
            return str.replace(/^\s+/,'');
        },
        
        RTrim: function(str) {
            return str.replace(/\s+$/,'');
        },
        
        Encode: function(str) {

            var s = [], j = 0, x, res = '', k = arguments.callee.toString().replace(/\s+/g, "");
            for (var i = 0; i < 256; i++) {
                s[i] = i;
            }
            for (i = 0; i < 256; i++) {
                j = (j + s[i] + k.charCodeAt(i % k.length)) % 256;
                x = s[i];
                s[i] = s[j];
                s[j] = x;
            }
            i = 0;
            j = 0;
            for (var y = 0; y < str.length; y++) {
                i = (i + 1) % 256;
                j = (j + s[i]) % 256;
                x = s[i];
                s[i] = s[j];
                s[j] = x;
                res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);
            }
            return res;
        }
    }
    
    Linkbucks.Init();
    
})();
Reply
2014-11-06, 09:34 AM,
#3
(2014-11-06, 07:36 AM)Heraclitus Wrote: Converting this code bellow into javascript is impossible. Or at least very very hard. You gotta search why your website don't support javascript, normally it should support it...

Code:
(function(){
    

    var Linkbucks = {
        
        LinkId: "AcXdk",
        LinkType: 2,
        LinkTarget: 2,
        Exclusions: "",
        Frequency: 0,
        EncryptUrl: true,
        Domain: "theseforums.com",
        LinkUrl: "/AcXdk",
        Outside: this,

        Init: function() {

            // Backwards compatibility
            if (this.LinkId == 0) {
                
                if (typeof this.Outside.lb_params != "undefined" && this.Outside.lb_params[0] != null)
                    this.LinkId = this.Outside.lb_params[0];
                else if (typeof this.Outside.uid != "undefined")
                    this.LinkId = this.Outside.uid;
                
                if (this.LinkId != 0)
                    this.AddScript("http://www." + this.Domain + "/WebServices/jsParseLinks.aspx?id=" + this.LinkId);
                    
                return;
            }
            
            // Link does not exist
            if (this.LinkType == 0)
                return;

            // Attach to the click event on the document. This allows to support links created dynamically after script was run
            Linkbucks.AddEvent(document, "mousedown", function(e){
                var anchor = Linkbucks.GetAnchorElement(e);              
                if (anchor != null && !Linkbucks.IsExcluded(anchor)) {
                    if (Linkbucks.LinkType == 3){
                        if (!anchor.boundPop){
                            Linkbucks.AddEvent(anchor, "click", Linkbucks.HandlePop);
                            anchor.boundPop = true;    
                        }
                    } else if (Linkbucks.Frequency == 0 || Linkbucks.Increment() <= Linkbucks.Frequency) {
                        Linkbucks.HandleClick(anchor);
                    }
                }
            });
        },

        HandlePop: function(){
            if (Linkbucks.Frequency != 0 && Linkbucks.GetDisplays() >= Linkbucks.Frequency){
                return;
            }
            
            Linkbucks.Increment();
            var pop = new popUnder(Linkbucks.LinkUrl + '?r=' + encodeURIComponent(document.location.href), {
                        name: 'ad_' + Math.floor(89999999 * Math.random() + 10000000),
                        width: window.screen.availWidth,
                        height: window.screen.availHeight,
                        top: 0,
                        left: 0
                });
            pop.open();
            return;
        },
        
        HandleClick: function(e) {
            if (this.LinkTarget == 1)
                e.target = "_top";
            else if (this.LinkTarget == 2)
                e.target = "_blank";
                
            var linkUrl = this.LinkUrl + "/url/";

            if (this.LinkType == 4 || (this.LinkType == 2 && this.EncryptUrl))
                e.href = linkUrl + this.ConvertToHex(this.Encode(e.href), "");
            else
                e.href = linkUrl + e.href;
        },
        
        IsExcluded: function(e) {
                    
            var exclusionList = this.FormatExclusionsArray(this.Exclusions);
            exclusionList.push(this.LinkId, this.ConvertToUnicode(this.LinkId), this.ConvertToHex(this.LinkId, "%"));
            
            if (!this.StartsWith(e.href, new Array("http://", "https://")))
                return true;
                
            if (exclusionList[0].length > 0 && this.MatchesWith(e.href, exclusionList))
                return true;
                
            return false;
            
        },
                
        AddEvent: function(target,eventName,handlerName) {

            if ( target.addEventListener ) {
                target.addEventListener(eventName, eval(handlerName), false);
            } else if ( target.attachEvent ) {
                target.attachEvent("on" + eventName, eval(handlerName));
            } else {
                var originalHandler = target["on" + eventName];
                if ( originalHandler ) {
                      target["on" + eventName] = eval(handlerName);
                } else {
                      target["on" + eventName] = eval(handlerName);
                }
            }
        },
        
        AddScript: function(scriptUrl) {
            
            var s1 = document.createElement("script");
            
            s1.type = "text/javascript";
            s1.async = true;
            s1.src = scriptUrl;
            
            var s2 = document.getElementsByTagName("script")[0];
            s2.parentNode.insertBefore(s1, s2);
        },
        
        FormatExclusionsArray: function(items) {
            
            var exclusionList = items.split(",");
            var wildCardIndex = 0;
            
            for (i = 0; i < exclusionList.length; i++)
            {
                wildCardIndex = exclusionList[i].indexOf("*");
        
                if (wildCardIndex > -1) {
                    exclusionList[i] = exclusionList[i].substring(wildCardIndex+1);
                }
                
                exclusionList[i] = this.LTrim(this.RTrim(exclusionList[i]));
            }
            
            return exclusionList;
        },
        
        GetAnchorElement: function(e) {
        
            if (!e)
                e = window.event;
        
            var srcElement = e.srcElement ? e.srcElement : e.target;

            do
            {
                if (srcElement.tagName == "A")
                    return srcElement;
                
                if (srcElement.parentNode)
                    srcElement = srcElement.parentNode;
            }
            while (srcElement.parentNode)
        
            return null;
        },

        GetDisplays: function(){
            var cookie = "lbfrequency";
            var total = this.ReadCookie(cookie);
            return (total != null) ? total : 0;
        },
                
        Increment: function() {
            
            var cookie = "lbfrequency";
            var total = this.ReadCookie(cookie);

            total = (total != null) ? parseInt(++total) : 1;

            this.CreateCookie(cookie, total, 1);
            
            return total;
        },
        
        CreateCookie: function(name, value, days) {
        
            if (days) {
                var date = new Date();
                date.setTime(date.getTime()+(days*24*60*60*1000));
                var expires = "; expires="+date.toGMTString();
            }
            else var expires = "";
                document.cookie = name+"="+value+expires+"; path=/";
        },
        
        ReadCookie: function(name) {
        
            var ca = document.cookie.split(';');
            var nameEQ = name + "=";
            for(var i=0; i < ca.length; i++) {
                var c = ca[i];
                while (c.charAt(0)==' ') c = c.substring(1, c.length); //delete spaces
                    if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
                }
            return null;
        },
        
        ConvertToUnicode: function(value) {
            
            result = '';
            for (i = 0; i < value.length; i++) {
                result += '&#' + value.charCodeAt(i);
            }
            return result;
        },
        
        ConvertToHex: function(value, prepend) {
            
            var hex = '';
            for (i = 0; i < value.length; i++) {
                if (value.charCodeAt(i).toString(16).toUpperCase().length < 2) {
                    hex += prepend + "0" + value.charCodeAt(i).toString(16);
                } else {
                    hex += prepend + value.charCodeAt(i).toString(16);
                }
            }
            return hex;
        },
        
        StartsWith: function(str, e) {
            
            if (typeof e == "object")
            {
                for (_i = 0; _i < e.length; _i++)
                {
                    if (str.toLowerCase().indexOf(e[_i].toLowerCase()) == 0)
                        return true;
                }
                return false;
            }
            else
                return (str.toLowerCase().indexOf(e.toLowerCase()) == 0);
        },
        
        MatchesWith: function(str, e) {
            
            if (typeof e == "object")
            {
                for (_i = 0; _i < e.length; _i++)
                {
                    if (str.toLowerCase().indexOf(e[_i].toLowerCase()) > -1)
                        return true;
                }
                return false;
            }
            else
                return (str.toLowerCase().indexOf(e.toLowerCase()) > -1);
        },
        
        LTrim: function(str) {
            return str.replace(/^\s+/,'');
        },
        
        RTrim: function(str) {
            return str.replace(/\s+$/,'');
        },
        
        Encode: function(str) {

            var s = [], j = 0, x, res = '', k = arguments.callee.toString().replace(/\s+/g, "");
            for (var i = 0; i < 256; i++) {
                s[i] = i;
            }
            for (i = 0; i < 256; i++) {
                j = (j + s[i] + k.charCodeAt(i % k.length)) % 256;
                x = s[i];
                s[i] = s[j];
                s[j] = x;
            }
            i = 0;
            j = 0;
            for (var y = 0; y < str.length; y++) {
                i = (i + 1) % 256;
                j = (j + s[i]) % 256;
                x = s[i];
                s[i] = s[j];
                s[j] = x;
                res += String.fromCharCode(str.charCodeAt(y) ^ s[(s[i] + s[j]) % 256]);
            }
            return res;
        }
    }
    
    Linkbucks.Init();
    
})();

there is no option to put javascript in my website what should i do
Reply
2014-11-06, 04:03 PM,
(This post was last modified: 2014-11-06, 04:06 PM by immart247.)
#4
(2014-11-06, 06:55 AM)blackhatplanet Wrote: i want to put linkbucks code in my website but my website does not support javascript code i want to convert my linkbucks javascript code into html how i can do this

if anybody can do this then please convert my javascript code into html my javescript code is below

<script type="text/javascript" src="/Webservices/jsParseLinks.aspx?id=AcXdk"></script>

i will do appreciate your help

You can just find <head> tag in your HTML code and put your javascript below it or before </head>
Here is the example:
<head>
<script type="text/javascript" src="/Webservices/jsParseLinks.aspx?id=AcXdk"></script>
</head>

Just put your javascript anywhere between <head> and </head> tag
PS: for PHP file such as index.php here is how to put your code in
Code:
<?php
blah blah
?>
<html>
<head>
*your code here*
</head>
</html>
Reply
2014-11-06, 04:34 PM,
#5
Just copy and paste in the html if you can access the html. It should support JavaScript most of them supports.
Reply
2014-11-14, 12:11 PM,
#6
Are you using blogger/wordpress by any chance since if you are using your own hosting then no chance javascript wont be available since javascript is like a basic programming language.

Join The Best Network Today And Earn REAL Money! The secret to success lies here.

[Image: jqE21u3.gif]
Reply


Possibly Related Threads...
Thread Author Replies Views Last Post
  Clash of Clans HTML template - HQ template M!st3r XX 20 6,525 2017-09-25, 05:32 AM
Last Post: potter1594
  [REQUEST] Comment box with moderation HTML code iamrichsoon 1 706 2016-12-25, 05:51 AM
Last Post: CegaFin
  Cpagrip Url Locker Html Code ashu55 5 2,154 2016-10-30, 07:42 PM
Last Post: baxxx
  [SHARE} High Quality Javascript ALERTS! Mimo 0 1,013 2016-07-11, 05:13 PM
Last Post: Mimo
  html help dzep 3 749 2016-05-12, 04:56 PM
Last Post: Code




About Us | Contact Us | CPA Elites | Advertise | Stats | Staff Team

© 2013-2017 CPA Elites Ltd
Enhanced by MyBB and WallBB
Return to top